{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "1ec02432-a44d-4fdb-b44c-b153529fc03d",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-10-20T19:58:31.247827Z",
     "start_time": "2024-10-20T19:58:24.650343Z"
    }
   },
   "outputs": [],
   "source": [
    "from guidance.models import Transformers\n",
    "from guidance import gen, user, system\n",
    "\n",
    "import logging\n",
    "logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s',\n",
    "                    datefmt='%Y-%m-%d %H:%M:%S')\n",
    "logging.getLogger().setLevel(logging.DEBUG)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "18b70f42-4b6d-41a4-94be-a41360571901",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2025-07-01 01:17:51 - DEBUG - Starting new HTTPS connection (1): huggingface.co:443\n",
      "2025-07-01 01:17:51 - DEBUG - https://huggingface.co:443 \"HEAD /gpt2/resolve/main/config.json HTTP/1.1\" 200 0\n",
      "2025-07-01 01:17:52 - DEBUG - https://huggingface.co:443 \"HEAD /gpt2/resolve/main/generation_config.json HTTP/1.1\" 200 0\n",
      "2025-07-01 01:17:52 - DEBUG - https://huggingface.co:443 \"HEAD /gpt2/resolve/main/custom_generate/generate.py HTTP/1.1\" 404 0\n",
      "2025-07-01 01:17:52 - DEBUG - https://huggingface.co:443 \"HEAD /gpt2/resolve/main/tokenizer_config.json HTTP/1.1\" 200 0\n",
      "2025-07-01 01:17:52 - DEBUG - https://huggingface.co:443 \"GET /api/models/gpt2/tree/main/additional_chat_templates?recursive=False&expand=False HTTP/1.1\" 307 133\n",
      "2025-07-01 01:17:52 - DEBUG - https://huggingface.co:443 \"GET /api/models/openai-community/gpt2/tree/main/additional_chat_templates?recursive=False&expand=False HTTP/1.1\" 404 64\n",
      "2025-07-01 01:17:52 - DEBUG - Using selector: EpollSelector\n",
      "2025-07-01 01:17:52 - WARNING - gpustat is not installed, run `pip install gpustat` to collect GPU stats.\n",
      "2025-07-01 01:17:52 - DEBUG - MONITOR:start\n",
      "2025-07-01 01:17:52 - DEBUG - INIT:engine(139701619453648)\n",
      "2025-07-01 01:17:52 - DEBUG - RECV:init\n",
      "2025-07-01 01:17:52 - DEBUG - SEND:init\n",
      "2025-07-01 01:17:52 - DEBUG - EXCHANGE:pre_subscribe:[]\n",
      "2025-07-01 01:17:52 - DEBUG - EXCHANGE:post_subscribe:[<bound method JupyterWidgetRenderer._on_exchange of <guidance.visual._renderer.JupyterWidgetRenderer object at 0x7f0ec491b8f0>>]\n",
      "2025-07-01 01:17:52 - DEBUG - RENDERER:execution start, currently have 0 stored messages\n",
      "2025-07-01 01:17:52 - INFO - RENDERER:cell_id:None:4861d16f-7e45-4b9c-846e-5e7e7d449d8c\n",
      "2025-07-01 01:17:52 - DEBUG - RENDERER:new widget needed\n",
      "2025-07-01 01:17:52 - DEBUG - RENDERER:widget observed (new)\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "57af12287d834c6dae122fbe39143553",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "StitchWidget(initial_height='auto', initial_width='100%', srcdoc='<!doctype html>\\n<html lang=\"en\">\\n<head>\\n …"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2025-07-01 01:17:52 - DEBUG - RENDERER:widget displayed\n",
      "Passing a tuple of `past_key_values` is deprecated and will be removed in Transformers v4.53.0. You should pass an instance of `Cache` instead, e.g. `past_key_values=DynamicCache.from_legacy_cache(past_key_values)`.\n",
      "2025-07-01 01:17:52 - DEBUG - SEND:ready\n",
      "2025-07-01 01:17:52 - DEBUG - Adding additional output to trace node 9, now has 2 outputs\n",
      "2025-07-01 01:17:52 - DEBUG - Adding additional output to trace node 26, now has 2 outputs\n",
      "2025-07-01 01:17:52 - DEBUG - Adding additional output to trace node 34, now has 2 outputs\n",
      "2025-07-01 01:17:52 - DEBUG - start gen(name=\"None\")\n",
      "2025-07-01 01:17:53 - DEBUG - DIVERGENCE:curr:identifier=48 parent=18:None:[TokenOutput:'\\n':True:2.9237747192382812:Token(token='\\n', bytes=b'\\n', prob=0.12064877897500992, masked=False)] children=[] input=RoleCloserInput:'system' output=[]\n",
      "2025-07-01 01:17:53 - DEBUG - DIVERGENCE:prev:identifier=47 parent=46:None:[TokenOutput:' and':True:18.631458282470703:Token(token=' and', bytes=b' and', prob=0.5621321201324463, masked=False)] children=[] input=None output=[TokenOutput:' blue':True:16.449451446533203:Token(token=' blue', bytes=b' blue', prob=0.41020849347114563, masked=False)]\n",
      "2025-07-01 01:17:53 - DEBUG - RENDERER:diverged, shared ancestor idx: 25\n",
      "2025-07-01 01:17:53 - DEBUG - Adding additional output to trace node 55, now has 2 outputs\n",
      "2025-07-01 01:17:53 - DEBUG - Adding additional output to trace node 63, now has 2 outputs\n",
      "2025-07-01 01:17:53 - DEBUG - start gen(name=\"None\")\n",
      "2025-07-01 01:17:53 - DEBUG - CELL_COMPLETE:executed\n",
      "2025-07-01 01:17:53 - DEBUG - RENDERER:execution end\n",
      "2025-07-01 01:17:55 - DEBUG - RECV:clientready\n"
     ]
    }
   ],
   "source": [
    "m0 = Transformers(\"gpt2\")\n",
    "\n",
    "with system():\n",
    "    m1 = m0 + \"You are responsible for writing an epic poem.\\n\"\n",
    "with user():\n",
    "    m2 = m1 + \"Roses are red and \" + gen(regex=r'[\\w\\s]{20,30}', max_tokens=30)\n",
    "    m3 = m1 + \"Space invaders in the air \" + gen(regex=r'[\\w\\s]{20,50}', max_tokens=30)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "5a5d668a11bda28f",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2025-07-01 01:17:53 - DEBUG - https://huggingface.co:443 \"HEAD /gpt2/resolve/main/config.json HTTP/1.1\" 200 0\n",
      "2025-07-01 01:17:53 - DEBUG - https://huggingface.co:443 \"HEAD /gpt2/resolve/main/generation_config.json HTTP/1.1\" 200 0\n",
      "2025-07-01 01:17:53 - DEBUG - https://huggingface.co:443 \"HEAD /gpt2/resolve/main/custom_generate/generate.py HTTP/1.1\" 404 0\n",
      "2025-07-01 01:17:53 - DEBUG - https://huggingface.co:443 \"HEAD /gpt2/resolve/main/tokenizer_config.json HTTP/1.1\" 200 0\n",
      "2025-07-01 01:17:54 - DEBUG - https://huggingface.co:443 \"GET /api/models/gpt2/tree/main/additional_chat_templates?recursive=False&expand=False HTTP/1.1\" 307 133\n",
      "2025-07-01 01:17:54 - DEBUG - https://huggingface.co:443 \"GET /api/models/openai-community/gpt2/tree/main/additional_chat_templates?recursive=False&expand=False HTTP/1.1\" 404 64\n",
      "2025-07-01 01:17:54 - DEBUG - INIT:engine(139701404721104)\n",
      "2025-07-01 01:17:54 - DEBUG - RENDERER:execution start, currently have 87 stored messages\n",
      "2025-07-01 01:17:54 - INFO - RENDERER:cell_id:4861d16f-7e45-4b9c-846e-5e7e7d449d8c:c56e3f61-fc59-43fd-a60d-0de84daebb7e\n",
      "2025-07-01 01:17:54 - DEBUG - DIVERGENCE:curr:identifier=84 parent=83:None:[] children=[] input=LiteralInput:'What is this?\\n' output=[]\n",
      "2025-07-01 01:17:54 - DEBUG - DIVERGENCE:prev:identifier=82 parent=81:None:[TokenOutput:' can':True:18.804550170898438:Token(token=' can', bytes=b' can', prob=0.4893622100353241, masked=False)] children=[] input=None output=[TokenOutput:' stop':True:16.137361526489258:Token(token=' stop', bytes=b' stop', prob=0.14686091244220734, masked=False)]\n",
      "2025-07-01 01:17:54 - DEBUG - DIVERGENCE:full reset (not in messages)\n",
      "2025-07-01 01:17:54 - DEBUG - RENDERER:diverged, shared ancestor idx: -1\n",
      "2025-07-01 01:17:54 - DEBUG - RENDERER:diverged, but no shared ancestor, replay\n",
      "2025-07-01 01:17:54 - DEBUG - RENDERER:new widget needed\n",
      "2025-07-01 01:17:54 - DEBUG - RENDERER:widget unobserved (new)\n",
      "2025-07-01 01:17:54 - DEBUG - RENDERER:widget observed (new)\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "e103399df51c42188fefaba571716656",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "StitchWidget(initial_height='auto', initial_width='100%', srcdoc='<!doctype html>\\n<html lang=\"en\">\\n<head>\\n …"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2025-07-01 01:17:54 - DEBUG - RENDERER:widget displayed\n",
      "2025-07-01 01:17:54 - DEBUG - start gen(name=\"None\")\n",
      "2025-07-01 01:17:55 - DEBUG - CELL_COMPLETE:executed\n",
      "2025-07-01 01:17:55 - DEBUG - RENDERER:execution end\n"
     ]
    }
   ],
   "source": [
    "m4 = Transformers(\"gpt2\")\n",
    "m5 = m4 + \"What is this?\\n\"\n",
    "m6 = m5 + gen(max_tokens=30, stop='.')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "e891c74b-5c8c-447e-a97a-c355544358ca",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'What is this?\\n\\nThis is a simple, yet powerful tool for creating a simple, and easy to use, web application'"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "str(m6)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "23923b84-7d0f-44ae-a0ea-1aaa3aa18bac",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0:0:None:[]\n",
      "└── 1:1:RoleOpenerInput:'system':[TokenOutput:'<':True:9.620348612467447:Token(token='<', bytes=b'<', prob=0.001087760436348617, masked=False)]\n",
      "    └── 2:2:None:[TokenOutput:'|':True:9.620348612467447:Token(token='|', bytes=b'|', prob=8.346515096491203e-05, masked=False)]\n",
      "        └── 3:3:None:[TokenOutput:'im':True:9.620348612467447:Token(token='im', bytes=b'im', prob=3.3653293940005824e-05, masked=False)]\n",
      "            └── 4:4:None:[TokenOutput:'_':True:9.620348612467447:Token(token='_', bytes=b'_', prob=0.0332084596157074, masked=False)]\n",
      "                └── 5:5:None:[TokenOutput:'start':True:9.620348612467447:Token(token='start', bytes=b'start', prob=0.0012612820137292147, masked=False)]\n",
      "                    └── 6:6:None:[TokenOutput:'|':True:9.620348612467447:Token(token='|', bytes=b'|', prob=0.04734868183732033, masked=False)]\n",
      "                        └── 7:7:None:[TokenOutput:'>':True:9.620348612467447:Token(token='>', bytes=b'>', prob=0.17809639871120453, masked=False)]\n",
      "                            └── 8:8:None:[TokenOutput:'system':True:9.620348612467447:Token(token='system', bytes=b'system', prob=3.195059980498627e-05, masked=False)]\n",
      "                                └── 9:9:LiteralInput:'You are responsible for writing an epic poem.\\n':[TokenOutput:'\\n':True:9.620348612467447:Token(token='\\n', bytes=b'\\n', prob=0.029929453507065773, masked=False), TokenOutput:'You':True:2.9237747192382812:Token(token='You', bytes=b'You', prob=nan, masked=False)]\n",
      "                                    └── 10:10:None:[TokenOutput:' are':True:2.9237747192382812:Token(token=' are', bytes=b' are', prob=0.06142207980155945, masked=False)]\n",
      "                                        └── 11:11:None:[TokenOutput:' responsible':True:2.9237747192382812:Token(token=' responsible', bytes=b' responsible', prob=0.0007107759010978043, masked=False)]\n",
      "                                            └── 12:12:None:[TokenOutput:' for':True:2.9237747192382812:Token(token=' for', bytes=b' for', prob=0.9593822360038757, masked=False)]\n",
      "                                                └── 13:13:None:[TokenOutput:' writing':True:2.9237747192382812:Token(token=' writing', bytes=b' writing', prob=0.0078015937469899654, masked=False)]\n",
      "                                                    └── 14:14:None:[TokenOutput:' an':True:2.9237747192382812:Token(token=' an', bytes=b' an', prob=0.009118388406932354, masked=False)]\n",
      "                                                        └── 15:15:None:[TokenOutput:' epic':True:2.9237747192382812:Token(token=' epic', bytes=b' epic', prob=0.00017329402908217162, masked=False)]\n",
      "                                                            └── 16:16:None:[TokenOutput:' poem':True:2.9237747192382812:Token(token=' poem', bytes=b' poem', prob=0.024180758744478226, masked=False)]\n",
      "                                                                └── 17:17:None:[TokenOutput:'.':True:2.9237747192382812:Token(token='.', bytes=b'.', prob=0.16378816962242126, masked=False)]\n",
      "                                                                    └── 18:18:None:[TokenOutput:'\\n':True:2.9237747192382812:Token(token='\\n', bytes=b'\\n', prob=0.12064877897500992, masked=False)]\n",
      "                                                                        ├── 19:19:RoleCloserInput:'system':[TokenOutput:'<':True:3.7816762924194336:Token(token='<', bytes=b'<', prob=nan, masked=False)]\n",
      "                                                                        │   └── 20:20:None:[TokenOutput:'|':True:3.7816762924194336:Token(token='|', bytes=b'|', prob=0.6335166096687317, masked=False)]\n",
      "                                                                        │       └── 21:21:None:[TokenOutput:'im':True:3.7816762924194336:Token(token='im', bytes=b'im', prob=0.6766183972358704, masked=False)]\n",
      "                                                                        │           └── 22:22:None:[TokenOutput:'_':True:3.7816762924194336:Token(token='_', bytes=b'_', prob=0.998134970664978, masked=False)]\n",
      "                                                                        │               └── 23:23:None:[TokenOutput:'end':True:3.7816762924194336:Token(token='end', bytes=b'end', prob=0.442425936460495, masked=False)]\n",
      "                                                                        │                   └── 24:24:None:[TokenOutput:'|':True:3.7816762924194336:Token(token='|', bytes=b'|', prob=0.9877830147743225, masked=False)]\n",
      "                                                                        │                       └── 25:25:None:[TokenOutput:'>':True:3.7816762924194336:Token(token='>', bytes=b'>', prob=0.9949510097503662, masked=False)]\n",
      "                                                                        │                           └── 26:26:RoleOpenerInput:'user':[TokenOutput:'\\n':True:3.7816762924194336:Token(token='\\n', bytes=b'\\n', prob=0.008451960049569607, masked=False), TokenOutput:'<':True:3.3158196343315973:Token(token='<', bytes=b'<', prob=nan, masked=False)]\n",
      "                                                                        │                               └── 27:27:None:[TokenOutput:'|':True:3.3158196343315973:Token(token='|', bytes=b'|', prob=0.8683732748031616, masked=False)]\n",
      "                                                                        │                                   └── 28:28:None:[TokenOutput:'im':True:3.3158196343315973:Token(token='im', bytes=b'im', prob=0.7896184325218201, masked=False)]\n",
      "                                                                        │                                       └── 29:29:None:[TokenOutput:'_':True:3.3158196343315973:Token(token='_', bytes=b'_', prob=0.999599039554596, masked=False)]\n",
      "                                                                        │                                           └── 30:30:None:[TokenOutput:'start':True:3.3158196343315973:Token(token='start', bytes=b'start', prob=0.3575568199157715, masked=False)]\n",
      "                                                                        │                                               └── 31:31:None:[TokenOutput:'|':True:3.3158196343315973:Token(token='|', bytes=b'|', prob=0.8891671299934387, masked=False)]\n",
      "                                                                        │                                                   └── 32:32:None:[TokenOutput:'>':True:3.3158196343315973:Token(token='>', bytes=b'>', prob=0.9821702241897583, masked=False)]\n",
      "                                                                        │                                                       └── 33:33:None:[TokenOutput:'user':True:3.3158196343315973:Token(token='user', bytes=b'user', prob=0.002075085649266839, masked=False)]\n",
      "                                                                        │                                                           └── 34:34:LiteralInput:'Roses are red and ':[TokenOutput:'\\n':True:3.3158196343315973:Token(token='\\n', bytes=b'\\n', prob=0.5920996069908142, masked=False), TokenOutput:'R':True:4.555424054463704:Token(token='R', bytes=b'R', prob=nan, masked=False)]\n",
      "                                                                        │                                                               └── 35:35:None:[TokenOutput:'oses':True:4.555424054463704:Token(token='oses', bytes=b'oses', prob=0.00265035149641335, masked=False)]\n",
      "                                                                        │                                                                   └── 36:36:None:[TokenOutput:' are':True:4.555424054463704:Token(token=' are', bytes=b' are', prob=0.14147108793258667, masked=False)]\n",
      "                                                                        │                                                                       └── 37:37:None:[TokenOutput:' red':True:4.555424054463704:Token(token=' red', bytes=b' red', prob=0.0005684680654667318, masked=False)]\n",
      "                                                                        │                                                                           └── 38:38:None:[TokenOutput:' and':True:4.555424054463704:Token(token=' and', bytes=b' and', prob=0.09786324948072433, masked=False)]\n",
      "                                                                        │                                                                               └── 39:39:None:[TokenOutput:' ':True:4.555424054463704:Token(token=' ', bytes=b' ', prob=0.0003277090145274997, masked=False)]\n",
      "                                                                        │                                                                                   └── 40:40:StatelessGuidanceInput({{G|139701404143056|G}}):[Backtrack:1:b' ']\n",
      "                                                                        │                                                                                       └── 41:41:None:[TokenOutput:' white':True:18.730878829956055:Token(token=' white', bytes=b' white', prob=1.0, masked=False)]\n",
      "                                                                        │                                                                                           └── 42:42:None:[TokenOutput:' and':True:18.55635643005371:Token(token=' and', bytes=b' and', prob=1.0, masked=False)]\n",
      "                                                                        │                                                                                               └── 43:43:None:[TokenOutput:' blue':True:18.375158309936523:Token(token=' blue', bytes=b' blue', prob=1.0, masked=False)]\n",
      "                                                                        │                                                                                                   └── 44:44:None:[TokenOutput:' and':True:18.72110366821289:Token(token=' and', bytes=b' and', prob=1.0, masked=False)]\n",
      "                                                                        │                                                                                                       └── 45:45:None:[TokenOutput:' red':True:18.69964599609375:Token(token=' red', bytes=b' red', prob=1.0, masked=False)]\n",
      "                                                                        │                                                                                                           └── 46:46:None:[TokenOutput:' and':True:18.631458282470703:Token(token=' and', bytes=b' and', prob=0.5621321201324463, masked=False)]\n",
      "                                                                        │                                                                                                               └── 47:47:None:[TokenOutput:' blue':True:16.449451446533203:Token(token=' blue', bytes=b' blue', prob=0.41020849347114563, masked=False)]\n",
      "                                                                        └── 48:48:RoleCloserInput:'system':[TokenOutput:'<':True:2.5953054428100586:Token(token='<', bytes=b'<', prob=nan, masked=False)]\n",
      "                                                                            └── 49:49:None:[TokenOutput:'|':True:2.5953054428100586:Token(token='|', bytes=b'|', prob=nan, masked=False)]\n",
      "                                                                                └── 50:50:None:[TokenOutput:'im':True:2.5953054428100586:Token(token='im', bytes=b'im', prob=nan, masked=False)]\n",
      "                                                                                    └── 51:51:None:[TokenOutput:'_':True:2.5953054428100586:Token(token='_', bytes=b'_', prob=nan, masked=False)]\n",
      "                                                                                        └── 52:52:None:[TokenOutput:'end':True:2.5953054428100586:Token(token='end', bytes=b'end', prob=nan, masked=False)]\n",
      "                                                                                            └── 53:53:None:[TokenOutput:'|':True:2.5953054428100586:Token(token='|', bytes=b'|', prob=nan, masked=False)]\n",
      "                                                                                                └── 54:54:None:[TokenOutput:'>':True:2.5953054428100586:Token(token='>', bytes=b'>', prob=nan, masked=False)]\n",
      "                                                                                                    └── 55:55:RoleOpenerInput:'user':[TokenOutput:'\\n':True:2.5953054428100586:Token(token='\\n', bytes=b'\\n', prob=nan, masked=False), TokenOutput:'<':True:3.66263919406467:Token(token='<', bytes=b'<', prob=nan, masked=False)]\n",
      "                                                                                                        └── 56:56:None:[TokenOutput:'|':True:3.66263919406467:Token(token='|', bytes=b'|', prob=0.8683731555938721, masked=False)]\n",
      "                                                                                                            └── 57:57:None:[TokenOutput:'im':True:3.66263919406467:Token(token='im', bytes=b'im', prob=0.7896184325218201, masked=False)]\n",
      "                                                                                                                └── 58:58:None:[TokenOutput:'_':True:3.66263919406467:Token(token='_', bytes=b'_', prob=0.9995989203453064, masked=False)]\n",
      "                                                                                                                    └── 59:59:None:[TokenOutput:'start':True:3.66263919406467:Token(token='start', bytes=b'start', prob=0.3575553894042969, masked=False)]\n",
      "                                                                                                                        └── 60:60:None:[TokenOutput:'|':True:3.66263919406467:Token(token='|', bytes=b'|', prob=0.8891666531562805, masked=False)]\n",
      "                                                                                                                            └── 61:61:None:[TokenOutput:'>':True:3.66263919406467:Token(token='>', bytes=b'>', prob=0.9821701049804688, masked=False)]\n",
      "                                                                                                                                └── 62:62:None:[TokenOutput:'user':True:3.66263919406467:Token(token='user', bytes=b'user', prob=0.002075079595670104, masked=False)]\n",
      "                                                                                                                                    └── 63:63:LiteralInput:'Space invaders in the air ':[TokenOutput:'\\n':True:3.66263919406467:Token(token='\\n', bytes=b'\\n', prob=0.5920996069908142, masked=False), TokenOutput:'Space':True:4.513700803120931:Token(token='Space', bytes=b'Space', prob=nan, masked=False)]\n",
      "                                                                                                                                        └── 64:64:None:[TokenOutput:' invaders':True:4.513700803120931:Token(token=' invaders', bytes=b' invaders', prob=0.0001069051431841217, masked=False)]\n",
      "                                                                                                                                            └── 65:65:None:[TokenOutput:' in':True:4.513700803120931:Token(token=' in', bytes=b' in', prob=0.007518881931900978, masked=False)]\n",
      "                                                                                                                                                └── 66:66:None:[TokenOutput:' the':True:4.513700803120931:Token(token=' the', bytes=b' the', prob=0.1956624686717987, masked=False)]\n",
      "                                                                                                                                                    └── 67:67:None:[TokenOutput:' air':True:4.513700803120931:Token(token=' air', bytes=b' air', prob=0.006806797347962856, masked=False)]\n",
      "                                                                                                                                                        └── 68:68:None:[TokenOutput:' ':True:4.513700803120931:Token(token=' ', bytes=b' ', prob=0.00019589721341617405, masked=False)]\n",
      "                                                                                                                                                            └── 69:69:StatelessGuidanceInput({{G|139701406001888|G}}):[Backtrack:1:b' ']\n",
      "                                                                                                                                                                └── 70:70:None:[TokenOutput:' are':True:21.651506423950195:Token(token=' are', bytes=b' are', prob=1.0, masked=False)]\n",
      "                                                                                                                                                                    └── 71:71:None:[TokenOutput:' coming':True:17.41313934326172:Token(token=' coming', bytes=b' coming', prob=1.0, masked=False)]\n",
      "                                                                                                                                                                        └── 72:72:None:[TokenOutput:' for':True:18.55921745300293:Token(token=' for', bytes=b' for', prob=1.0, masked=False)]\n",
      "                                                                                                                                                                            └── 73:73:None:[TokenOutput:' you':True:19.212961196899414:Token(token=' you', bytes=b' you', prob=1.0, masked=False)]\n",
      "                                                                                                                                                                                └── 74:74:None:[TokenOutput:'\\n':True:16.517162322998047:Token(token='\\n', bytes=b'\\n', prob=1.0, masked=False)]\n",
      "                                                                                                                                                                                    └── 75:75:None:[TokenOutput:'You':True:15.751838684082031:Token(token='You', bytes=b'You', prob=1.0, masked=False)]\n",
      "                                                                                                                                                                                        └── 76:76:None:[TokenOutput:' are':True:17.345428466796875:Token(token=' are', bytes=b' are', prob=0.3161924183368683, masked=False)]\n",
      "                                                                                                                                                                                            └── 77:77:None:[TokenOutput:' the':True:16.854286193847656:Token(token=' the', bytes=b' the', prob=0.08701511472463608, masked=False)]\n",
      "                                                                                                                                                                                                └── 78:78:None:[TokenOutput:' only':True:16.675949096679688:Token(token=' only', bytes=b' only', prob=0.08055341243743896, masked=False)]\n",
      "                                                                                                                                                                                                    └── 79:79:None:[TokenOutput:' one':True:15.344619750976562:Token(token=' one', bytes=b' one', prob=0.5083239078521729, masked=False)]\n",
      "                                                                                                                                                                                                        └── 80:80:None:[TokenOutput:' who':True:18.89634132385254:Token(token=' who', bytes=b' who', prob=0.3364778161048889, masked=False)]\n",
      "                                                                                                                                                                                                            └── 81:81:None:[TokenOutput:' can':True:18.804550170898438:Token(token=' can', bytes=b' can', prob=0.4893622100353241, masked=False)]\n",
      "                                                                                                                                                                                                                └── 82:82:None:[TokenOutput:' stop':True:16.137361526489258:Token(token=' stop', bytes=b' stop', prob=0.14686091244220734, masked=False)]\n"
     ]
    }
   ],
   "source": [
    "from guidance.registry import get_trace_handler\n",
    "from guidance.visual import display_trace_tree\n",
    "\n",
    "display_trace_tree(get_trace_handler())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "610a2b0a-5429-48f8-9d16-39c3458cc992",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.3"
  },
  "widgets": {
   "application/vnd.jupyter.widget-state+json": {
    "state": {
     "0192c9786e50402f82505b1305c4c09a": {
      "model_module": "@guidance-ai/stitch",
      "model_module_version": "^0.1.4",
      "model_name": "StitchModel",
      "state": {
       "_model_module_version": "^0.1.4",
       "_view_module_version": "^0.1.4",
       "clientmsg": "{\"class_name\":\"ClientReadyMessage\"}",
       "initial_height": "auto",
       "initial_width": "100%",
       "kernelmsg": "{\n  \"message_id\": 113,\n  \"class_name\": \"ClientReadyAckMessage\"\n}",
       "layout": "IPY_MODEL_7651f89f191b49bcbfb8321d434af64e",
       "srcdoc": "<!doctype html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n\n    <link rel=\"preconnect\" href=\"https://fonts.googleapis.com\">\n    <link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin>\n    <link href=\"https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap\" rel=\"stylesheet\">\n</head>\n<body>\n<script>\nvar app=function(){\"use strict\";function t(){}function e(t){return t()}function n(){return Object.create(null)}function r(t){t.forEach(e)}function o(t){return\"function\"==typeof t}function i(t,e){return t!=t?e==e:t!==e||t&&\"object\"==typeof t||\"function\"==typeof t}let a;function l(t,e){return t===e||(a||(a=document.createElement(\"a\")),a.href=e,t===a.href)}function s(e,n,r){e.$$.on_destroy.push(function(e,...n){if(null==e){for(const t of n)t(void 0);return t}const r=e.subscribe(...n);return r.unsubscribe?()=>r.unsubscribe():r}(n,r))}function c(t){return null==t?\"\":t}function u(e){return e&&o(e.destroy)?e.destroy:t}const d=\"undefined\"!=typeof window?window:\"undefined\"!=typeof globalThis?globalThis:global;function p(t,e){t.appendChild(e)}function f(t,e,n){t.insertBefore(e,n||null)}function m(t){t.parentNode&&t.parentNode.removeChild(t)}function g(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function h(t){return document.createElement(t)}function b(t){return document.createElementNS(\"http://www.w3.org/2000/svg\",t)}function y(t){return document.createTextNode(t)}function w(){return y(\" \")}function x(){return y(\"\")}function v(t,e,n,r){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}function k(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function _(t,e){e=\"\"+e,t.data!==e&&(t.data=e)}function $(t,e){t.value=null==e?\"\":e}function E(t,e,n,r){null==n?t.style.removeProperty(e):t.style.setProperty(e,n,\"\")}let N,T;function M(){if(void 0===N){N=!1;try{\"undefined\"!=typeof window&&window.parent&&window.parent.document}catch(t){N=!0}}return N}function A(t){T=t}function S(){if(!T)throw new Error(\"Function called outside component initialization\");return T}function C(t){S().$$.on_mount.push(t)}function R(t){S().$$.on_destroy.push(t)}function D(){const t=S();return(e,n,{cancelable:r=!1}={})=>{const o=t.$$.callbacks[e];if(o){const i=function(t,e,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(t,{detail:e,bubbles:n,cancelable:r})}(e,n,{cancelable:r});return o.slice().forEach((e=>{e.call(t,i)})),!i.defaultPrevented}return!0}}const L=[],O=[];let I=[];const z=[],F=Promise.resolve();let P=!1;function U(t){I.push(t)}const H=new Set;let j=0;function q(){if(0!==j)return;const t=T;do{try{for(;j<L.length;){const t=L[j];j++,A(t),B(t.$$)}}catch(t){throw L.length=0,j=0,t}for(A(null),L.length=0,j=0;O.length;)O.pop()();for(let t=0;t<I.length;t+=1){const e=I[t];H.has(e)||(H.add(e),e())}I.length=0}while(L.length);for(;z.length;)z.pop()();P=!1,H.clear(),A(t)}function B(t){if(null!==t.fragment){t.update(),r(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(U)}}const W=new Set;let G;function Y(){G={r:0,c:[],p:G}}function V(){G.r||r(G.c),G=G.p}function X(t,e){t&&t.i&&(W.delete(t),t.i(e))}function J(t,e,n,r){if(t&&t.o){if(W.has(t))return;W.add(t),G.c.push((()=>{W.delete(t),r&&(n&&t.d(1),r())})),t.o(e)}else r&&r()}function K(t){return void 0!==t?.length?t:Array.from(t)}function Z(t){t&&t.c()}function Q(t,n,i){const{fragment:a,after_update:l}=t.$$;a&&a.m(n,i),U((()=>{const n=t.$$.on_mount.map(e).filter(o);t.$$.on_destroy?t.$$.on_destroy.push(...n):r(n),t.$$.on_mount=[]})),l.forEach(U)}function tt(t,e){const n=t.$$;null!==n.fragment&&(!function(t){const e=[],n=[];I.forEach((r=>-1===t.indexOf(r)?e.push(r):n.push(r))),n.forEach((t=>t())),I=e}(n.after_update),r(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function et(t,e){-1===t.$$.dirty[0]&&(L.push(t),P||(P=!0,F.then(q)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function nt(e,o,i,a,l,s,c=null,u=[-1]){const d=T;A(e);const p=e.$$={fragment:null,ctx:[],props:s,update:t,not_equal:l,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(o.context||(d?d.$$.context:[])),callbacks:n(),dirty:u,skip_bound:!1,root:o.target||d.$$.root};c&&c(p.root);let f=!1;if(p.ctx=i?i(e,o.props||{},((t,n,...r)=>{const o=r.length?r[0]:n;return p.ctx&&l(p.ctx[t],p.ctx[t]=o)&&(!p.skip_bound&&p.bound[t]&&p.bound[t](o),f&&et(e,t)),n})):[],p.update(),f=!0,r(p.before_update),p.fragment=!!a&&a(p.ctx),o.target){if(o.hydrate){const t=function(t){return Array.from(t.childNodes)}(o.target);p.fragment&&p.fragment.l(t),t.forEach(m)}else p.fragment&&p.fragment.c();o.intro&&X(e.$$.fragment),Q(e,o.target,o.anchor),q()}A(d)}class rt{$$=void 0;$$set=void 0;$destroy(){tt(this,1),this.$destroy=t}$on(e,n){if(!o(n))return t;const r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(n),()=>{const t=r.indexOf(n);-1!==t&&r.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function ot(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&\"undefined\"!=typeof document){var r=document.head||document.getElementsByTagName(\"head\")[0],o=document.createElement(\"style\");o.type=\"text/css\",\"top\"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}\"undefined\"!=typeof window&&(window.__svelte||(window.__svelte={v:new Set})).v.add(\"4\");ot('/*! tailwindcss v3.4.10 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:\"\"}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*{scrollbar-color:auto;scrollbar-width:auto}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.pointer-events-none{pointer-events:none}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.top-0{top:0}.z-10{z-index:10}.z-50{z-index:50}.my-2{margin-bottom:.5rem;margin-top:.5rem}.my-3{margin-bottom:.75rem;margin-top:.75rem}.-mt-4{margin-top:-1rem}.mb-5{margin-bottom:1.25rem}.ml-4{margin-left:1rem}.mr-2{margin-right:.5rem}.mr-4{margin-right:1rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.size-4{height:1rem;width:1rem}.h-0{height:0}.h-12{height:3rem}.h-2{height:.5rem}.h-4{height:1rem}.h-\\\\[20px\\\\]{height:20px}.h-\\\\[40px\\\\]{height:40px}.h-\\\\[6px\\\\]{height:6px}.h-full{height:100%}.min-h-72{min-height:18rem}.w-8{width:2rem}.w-\\\\[20px\\\\]{width:20px}.w-\\\\[400px\\\\]{width:400px}.w-\\\\[40px\\\\]{width:40px}.w-\\\\[60px\\\\]{width:60px}.w-full{width:100%}.min-w-\\\\[50px\\\\]{min-width:50px}.flex-grow{flex-grow:1}.basis-full{flex-basis:100%}@keyframes cpulse{50%{opacity:0}}.animate-cpulse{animation:cpulse 3.5s cubic-bezier(.4,0,.6,1) infinite}.cursor-pointer{cursor:pointer}.resize{resize:both}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-\\\\[10px\\\\]{gap:10px}.gap-\\\\[5px\\\\]{gap:5px}.overflow-x-scroll{overflow-x:scroll}.whitespace-nowrap{white-space:nowrap}.text-nowrap{text-wrap:nowrap}.rounded-\\\\[10px\\\\]{border-radius:10px}.rounded-\\\\[3px\\\\]{border-radius:3px}.rounded-full{border-radius:9999px}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity))}.border-gray-400{--tw-border-opacity:1;border-color:rgb(156 163 175/var(--tw-border-opacity))}.border-white{--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}.bg-\\\\[\\\\#2979ff\\\\]{--tw-bg-opacity:1;background-color:rgb(41 121 255/var(--tw-bg-opacity))}.bg-\\\\[\\\\#6c7a89\\\\]{--tw-bg-opacity:1;background-color:rgb(108 122 137/var(--tw-bg-opacity))}.bg-\\\\[\\\\#ddd\\\\]{--tw-bg-opacity:1;background-color:rgb(221 221 221/var(--tw-bg-opacity))}.bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.bg-gray-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity))}.bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.fill-white{fill:#fff}.p-\\\\[10px\\\\]{padding:10px}.px-1{padding-left:.25rem;padding-right:.25rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-top:.25rem}.pb-1,.py-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-6{padding-bottom:1.5rem}.pl-1{padding-left:.25rem}.pr-\\\\[0\\\\.125rem\\\\]{padding-right:.125rem}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.pt-6{padding-top:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.font-token{font-family:JetBrains Mono}.text-2xl{font-size:1.5rem;line-height:2rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-normal{font-weight:400}.uppercase{text-transform:uppercase}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.text-\\\\[\\\\#555\\\\]{--tw-text-opacity:1;color:rgb(85 85 85/var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity))}.text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity))}.text-purple-800{--tw-text-opacity:1;color:rgb(107 33 168/var(--tw-text-opacity))}.text-red-700{--tw-text-opacity:1;color:rgb(185 28 28/var(--tw-text-opacity))}.underline{text-decoration-line:underline}.line-through{text-decoration-line:line-through}.decoration-2{text-decoration-thickness:2px}.opacity-90{opacity:.9}.opacity-95{opacity:.95}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.scrollbar-thin::-webkit-scrollbar-track{background-color:var(--scrollbar-track);border-radius:var(--scrollbar-track-radius)}.scrollbar-thin::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb);border-radius:var(--scrollbar-thumb-radius)}.scrollbar-thin::-webkit-scrollbar-corner{background-color:var(--scrollbar-corner);border-radius:var(--scrollbar-corner-radius)}.scrollbar-thin{scrollbar-color:var(--scrollbar-thumb,initial) var(--scrollbar-track,initial);scrollbar-width:thin}.scrollbar-thin::-webkit-scrollbar{display:block;height:8px;width:8px}.scrollbar-track-gray-100{--scrollbar-track:#f3f4f6}.scrollbar-thumb-gray-200{--scrollbar-thumb:#e5e7eb}.hover\\\\:bg-gray-700:hover{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.hover\\\\:text-white:hover{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}');const it=[];function at(e,n=t){let r;const o=new Set;function a(t){if(i(e,t)&&(e=t,r)){const t=!it.length;for(const t of o)t[1](),it.push(t,e);if(t){for(let t=0;t<it.length;t+=2)it[t][0](it[t+1]);it.length=0}}}function l(t){a(t(e))}return{set:a,update:l,subscribe:function(i,s=t){const c=[i,s];return o.add(c),1===o.size&&(r=n(a,l)||t),i(e),()=>{o.delete(c),0===o.size&&r&&(r(),r=null)}}}}function lt(t){return null!=t&&\"RoleOpenerInput\"===t.class_name}function st(t){return null!=t&&\"TextOutput\"===t.class_name}function ct(t){return null!=t&&\"ImageOutput\"===t.class_name}function ut(t){return null!=t&&\"AudioOutput\"===t.class_name}function dt(t){return null!=t&&\"VideoOutput\"===t.class_name}var pt,ft=at(void 0),mt=at(void 0),gt=at(void 0);function ht(t){let e,n;return{c(){e=b(\"svg\"),n=b(\"polygon\"),k(n,\"points\",\"5,3 19,12 5,21\"),k(e,\"class\",\"fill-white w-[20px] h-[20px]\"),k(e,\"viewBox\",\"0 0 24 24\")},m(t,r){f(t,e,r),p(e,n)},d(t){t&&m(e)}}}function bt(t){let e,n,r;return{c(){e=b(\"svg\"),n=b(\"rect\"),r=b(\"rect\"),k(n,\"x\",\"6\"),k(n,\"y\",\"5\"),k(n,\"width\",\"4\"),k(n,\"height\",\"14\"),k(r,\"x\",\"14\"),k(r,\"y\",\"5\"),k(r,\"width\",\"4\"),k(r,\"height\",\"14\"),k(e,\"class\",\"fill-white w-[20px] h-[20px]\"),k(e,\"viewBox\",\"0 0 24 24\")},m(t,o){f(t,e,o),p(e,n),p(e,r)},d(t){t&&m(e)}}}function yt(e){let n,o,i,a,s,c,u,d,g,x,N,T,M,A,S,C,R,D,L,O,I,z,F,P,U,H=wt(e[5])+\"\",j=wt(e[4])+\"\";function q(t,e){return t[2]?bt:ht}let B=q(e),W=B(e);return{c(){n=h(\"div\"),o=h(\"div\"),i=h(\"div\"),W.c(),a=w(),s=h(\"div\"),c=h(\"canvas\"),u=w(),d=h(\"div\"),g=h(\"div\"),x=w(),N=h(\"div\"),T=y(H),M=y(\" / \"),A=y(j),S=w(),C=h(\"div\"),R=b(\"svg\"),D=b(\"path\"),L=w(),O=h(\"input\"),I=w(),z=h(\"audio\"),k(i,\"class\",\"w-[40px] h-[40px] rounded-full bg-[#6c7a89] flex items-center justify-center cursor-pointer\"),k(i,\"role\",\"button\"),k(i,\"tabindex\",\"0\"),k(i,\"aria-label\",\"Toggle playback\"),k(c,\"class\",\"w-full h-12\"),k(g,\"class\",\"h-full bg-[#2979ff] rounded-[3px] absolute\"),E(g,\"width\",e[3]+\"%\"),k(d,\"class\",\"h-[6px] bg-[#ddd] rounded-[3px] cursor-pointer relative\"),k(d,\"role\",\"slider\"),k(d,\"tabindex\",\"0\"),k(d,\"aria-label\",\"Seek\"),k(d,\"aria-valuemin\",\"0\"),k(d,\"aria-valuemax\",\"100\"),k(d,\"aria-valuenow\",e[3]),k(s,\"class\",\"flex flex-col flex-grow gap-1\"),k(N,\"class\",\"text-sm text-[#555] min-w-[50px]\"),k(D,\"d\",\"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.07c1.48-.74 2.5-2.26 2.5-4.04z\"),k(R,\"class\",\"w-[20px] h-[20px]\"),k(R,\"viewBox\",\"0 0 24 24\"),k(O,\"type\",\"range\"),k(O,\"min\",\"0\"),k(O,\"max\",\"1\"),k(O,\"step\",\"0.01\"),k(O,\"class\",\"w-[60px]\"),k(C,\"class\",\"flex items-center gap-[5px]\"),k(o,\"class\",\"flex items-center gap-[10px]\"),l(z.src,F=\"data:audio/wav;base64,\"+e[0])||k(z,\"src\",F),k(z,\"class\",\"hidden\"),k(n,\"class\",\"rounded-[10px] border border-gray-400 bg-white p-[10px] w-[400px]\")},m(t,r){f(t,n,r),p(n,o),p(o,i),W.m(i,null),p(o,a),p(o,s),p(s,c),e[13](c),p(s,u),p(s,d),p(d,g),p(o,x),p(o,N),p(N,T),p(N,M),p(N,A),p(o,S),p(o,C),p(C,R),p(R,D),p(C,L),p(C,O),$(O,e[6]),p(n,I),p(n,z),e[15](z),P||(U=[v(i,\"click\",e[8]),v(i,\"keydown\",e[8]),v(d,\"click\",e[10]),v(d,\"keydown\",e[10]),v(O,\"change\",e[14]),v(O,\"input\",e[14]),v(O,\"input\",e[11]),v(z,\"timeupdate\",e[9]),v(z,\"ended\",e[12])],P=!0)},p(t,[e]){B!==(B=q(t))&&(W.d(1),W=B(t),W&&(W.c(),W.m(i,null))),8&e&&E(g,\"width\",t[3]+\"%\"),8&e&&k(d,\"aria-valuenow\",t[3]),32&e&&H!==(H=wt(t[5])+\"\")&&_(T,H),16&e&&j!==(j=wt(t[4])+\"\")&&_(A,j),64&e&&$(O,t[6]),1&e&&!l(z.src,F=\"data:audio/wav;base64,\"+t[0])&&k(z,\"src\",F)},i:t,o:t,d(t){t&&m(n),W.d(),e[13](null),e[15](null),P=!1,r(U)}}}function wt(t){const e=Math.floor(t/60),n=Math.floor(t%60);return`${e}:${n<10?\"0\":\"\"}${n}`}function xt(t,e,n){let r,o,{audioData:i}=e,a=!1,l=0,s=0,c=0,u=1;async function d(){if(!i||!o)return;const t=new AudioContext,e=function(t){const e=atob(t),n=e.length,r=new Uint8Array(n);for(let t=0;t<n;t++)r[t]=e.charCodeAt(t);return r.buffer}(i);try{const n=(await t.decodeAudioData(e)).getChannelData(0),r=o;r.width=r.clientWidth,r.height=r.clientHeight;const i=r.width,a=r.height,l=i,s=Math.floor(n.length/l),c=new Array(l);for(let t=0;t<l;t++){let e=0;for(let r=0;r<s;r++)e+=Math.abs(n[t*s+r]);c[t]=e/s}const u=Math.max(...c),d=u>0?1/u:1,p=r.getContext(\"2d\");p.clearRect(0,0,i,a),p.fillStyle=\"#2979ff\";for(let t=0;t<l;t++){const e=t,n=c[t]*d*a,r=(a-n)/2;p.fillRect(e,r,1,n)}}catch(t){console.error(\"Error decoding audio for waveform:\",t)}}return C((()=>{d()})),t.$$set=t=>{\"audioData\"in t&&n(0,i=t.audioData)},[i,r,a,l,s,c,u,o,function(){r.paused?(r.play(),n(2,a=!0)):(r.pause(),n(2,a=!1))},function(){r&&(n(3,l=r.currentTime/r.duration*100),n(5,c=r.currentTime),n(4,s=r.duration||0))},function(t){const e=t.currentTarget,o=t.offsetX/e.offsetWidth*r.duration;n(1,r.currentTime=o,r)},function(t){n(6,u=t.target.value),n(1,r.volume=u,r)},function(){n(2,a=!1),n(3,l=0),n(5,c=0)},function(t){O[t?\"unshift\":\"push\"]((()=>{o=t,n(7,o)}))},function(){var t;t=this.value,u=\"\"===t?null:+t,n(6,u)},function(t){O[t?\"unshift\":\"push\"]((()=>{r=t,n(1,r)}))}]}!function(t){t.Running=\"Running\",t.Error=\"Error\",t.Done=\"Done\"}(pt||(pt={}));class vt extends rt{constructor(t){super(),nt(this,t,xt,yt,i,{audioData:0})}}function kt(t,e,n){const r=t.slice();return r[4]=e[n],r[6]=n,r}function _t(t){let e,n,r,o,i,a,l=t[4]+\"\",s=0===t[6]&&function(t){let e,n,r=t[0].role+\"\";return{c(){e=h(\"span\"),n=y(r),k(e,\"class\",\"absolute text-xs uppercase -mt-4 text-purple-800 font-sans\")},m(t,r){f(t,e,r),p(e,n)},p(t,e){1&e&&r!==(r=t[0].role+\"\")&&_(n,r)},d(t){t&&m(e)}}}(t);return{c(){e=h(\"span\"),s&&s.c(),n=w(),r=y(l),o=w(),k(e,\"data-index\",t[1]),k(e,\"role\",\"tooltip\"),k(e,\"class\",i=\"token-grid-item inline-block mt-2 border-b-2 \"+(t[0].special?\"text-gray-300\":\"\")),k(e,\"style\",a=`${t[2]} ${t[3]}`)},m(t,i){f(t,e,i),s&&s.m(e,null),p(e,n),p(e,r),p(e,o)},p(t,n){0===t[6]&&s.p(t,n),1&n&&l!==(l=t[4]+\"\")&&_(r,l),2&n&&k(e,\"data-index\",t[1]),1&n&&i!==(i=\"token-grid-item inline-block mt-2 border-b-2 \"+(t[0].special?\"text-gray-300\":\"\"))&&k(e,\"class\",i),12&n&&a!==(a=`${t[2]} ${t[3]}`)&&k(e,\"style\",a)},d(t){t&&m(e),s&&s.d()}}}function $t(t){let e,n,r,o,i,a=0===t[6]&&function(t){let e,n,r=t[0].role+\"\";return{c(){e=h(\"span\"),n=y(r),k(e,\"class\",\"absolute text-xs uppercase -mt-4 text-purple-800 font-sans\")},m(t,r){f(t,e,r),p(e,n)},p(t,e){1&e&&r!==(r=t[0].role+\"\")&&_(n,r)},d(t){t&&m(e)}}}(t);return{c(){e=h(\"span\"),a&&a.c(),n=y(\"\\n            \\\\n\"),o=w(),i=h(\"div\"),k(e,\"data-index\",t[1]),k(e,\"role\",\"tooltip\"),k(e,\"class\",\"token-grid-item inline-block mt-2 border-b-2 text-gray-300\"),k(e,\"style\",r=`${t[2]} ${t[3]}`),k(i,\"class\",\"basis-full h-full\")},m(t,r){f(t,e,r),a&&a.m(e,null),p(e,n),f(t,o,r),f(t,i,r)},p(t,n){0===t[6]&&a.p(t,n),2&n&&k(e,\"data-index\",t[1]),12&n&&r!==(r=`${t[2]} ${t[3]}`)&&k(e,\"style\",r)},d(t){t&&(m(e),m(o),m(i)),a&&a.d()}}}function Et(t){let e,n,r,o=0===t[6]&&function(t){let e,n,r=t[0].role+\"\";return{c(){e=h(\"span\"),n=y(r),k(e,\"class\",\"absolute text-xs uppercase -mt-4 text-purple-800 font-sans\")},m(t,r){f(t,e,r),p(e,n)},p(t,e){1&e&&r!==(r=t[0].role+\"\")&&_(n,r)},d(t){t&&m(e)}}}(t);return{c(){e=h(\"span\"),o&&o.c(),n=y(\"\\n            \\\\t  \\n        \"),k(e,\"data-index\",t[1]),k(e,\"role\",\"tooltip\"),k(e,\"class\",\"token-grid-item inline-block mt-2 border-b-2 text-gray-300\"),k(e,\"style\",r=`${t[2]} ${t[3]}`)},m(t,r){f(t,e,r),o&&o.m(e,null),p(e,n)},p(t,n){0===t[6]&&o.p(t,n),2&n&&k(e,\"data-index\",t[1]),12&n&&r!==(r=`${t[2]} ${t[3]}`)&&k(e,\"style\",r)},d(t){t&&m(e),o&&o.d()}}}function Nt(t){let e,n,r,o=0===t[6]&&function(t){let e,n,r=t[0].role+\"\";return{c(){e=h(\"span\"),n=y(r),k(e,\"class\",\"absolute text-xs uppercase -mt-4 text-purple-800 font-sans\")},m(t,r){f(t,e,r),p(e,n)},p(t,e){1&e&&r!==(r=t[0].role+\"\")&&_(n,r)},d(t){t&&m(e)}}}(t);return{c(){e=h(\"span\"),o&&o.c(),n=y(\"\\n             \\n        \"),k(e,\"data-index\",t[1]),k(e,\"role\",\"tooltip\"),k(e,\"class\",\"token-grid-item inline-block mt-2 border-b-2 text-gray-300\"),k(e,\"style\",r=`${t[2]} ${t[3]}`)},m(t,r){f(t,e,r),o&&o.m(e,null),p(e,n)},p(t,n){0===t[6]&&o.p(t,n),2&n&&k(e,\"data-index\",t[1]),12&n&&r!==(r=`${t[2]} ${t[3]}`)&&k(e,\"style\",r)},d(t){t&&m(e),o&&o.d()}}}function Tt(t){let e;function n(t,e){return\" \"===t[4]?Nt:\"\\t\"===t[4]?Et:\"\\n\"===t[4]?$t:_t}let r=n(t),o=r(t);return{c(){o.c(),e=x()},m(t,n){o.m(t,n),f(t,e,n)},p(t,i){r===(r=n(t))&&o?o.p(t,i):(o.d(1),o=r(t),o&&(o.c(),o.m(e.parentNode,e)))},d(t){t&&m(e),o.d(t)}}}function Mt(e){let n,r=K(e[0].text),o=[];for(let t=0;t<r.length;t+=1)o[t]=Tt(kt(e,r,t));return{c(){for(let t=0;t<o.length;t+=1)o[t].c();n=x()},m(t,e){for(let n=0;n<o.length;n+=1)o[n]&&o[n].m(t,e);f(t,n,e)},p(t,[e]){if(15&e){let i;for(r=K(t[0].text),i=0;i<r.length;i+=1){const a=kt(t,r,i);o[i]?o[i].p(a,e):(o[i]=Tt(a),o[i].c(),o[i].m(n.parentNode,n))}for(;i<o.length;i+=1)o[i].d(1);o.length=r.length}},i:t,o:t,d(t){t&&m(n),g(o,t)}}}function At(t,e,n){let{token:r}=e,{index:o}=e,{underlineStyle:i=\"\"}=e,{bgStyle:a=\"\"}=e;return t.$$set=t=>{\"token\"in t&&n(0,r=t.token),\"index\"in t&&n(1,o=t.index),\"underlineStyle\"in t&&n(2,i=t.underlineStyle),\"bgStyle\"in t&&n(3,a=t.bgStyle)},[r,o,i,a]}class St extends rt{constructor(t){super(),nt(this,t,At,Mt,i,{token:0,index:1,underlineStyle:2,bgStyle:3})}}function Ct(t,e){var n,r=function(r){n=setTimeout((function(){t.dispatchEvent(new CustomEvent(\"longmouseover\",{detail:r}))}),e)},o=function(e){clearTimeout(n),t.dispatchEvent(new CustomEvent(\"longmouseout\",{detail:e}))};return t.addEventListener(\"mouseover\",r),t.addEventListener(\"mouseout\",o),{update:function(t){e=t},destroy:function(){t.removeEventListener(\"mouseover\",r),t.removeEventListener(\"mouseout\",o)}}}\"undefined\"!=typeof globalThis?globalThis:\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self&&self;function Rt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,\"default\")?t.default:t}var Dt={exports:{}};\n/*! @license DOMPurify 3.1.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.7/LICENSE */Dt.exports=function(){const{entries:t,setPrototypeOf:e,isFrozen:n,getPrototypeOf:r,getOwnPropertyDescriptor:o}=Object;let{freeze:i,seal:a,create:l}=Object,{apply:s,construct:c}=\"undefined\"!=typeof Reflect&&Reflect;i||(i=function(t){return t}),a||(a=function(t){return t}),s||(s=function(t,e,n){return t.apply(e,n)}),c||(c=function(t,e){return new t(...e)});const u=k(Array.prototype.forEach),d=k(Array.prototype.pop),p=k(Array.prototype.push),f=k(String.prototype.toLowerCase),m=k(String.prototype.toString),g=k(String.prototype.match),h=k(String.prototype.replace),b=k(String.prototype.indexOf),y=k(String.prototype.trim),w=k(Object.prototype.hasOwnProperty),x=k(RegExp.prototype.test),v=_(TypeError);function k(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return s(t,e,r)}}function _(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return c(t,n)}}function $(t,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:f;e&&e(t,null);let i=r.length;for(;i--;){let e=r[i];if(\"string\"==typeof e){const t=o(e);t!==e&&(n(r)||(r[i]=t),e=t)}t[e]=!0}return t}function E(t){for(let e=0;e<t.length;e++)w(t,e)||(t[e]=null);return t}function N(e){const n=l(null);for(const[r,o]of t(e))w(e,r)&&(Array.isArray(o)?n[r]=E(o):o&&\"object\"==typeof o&&o.constructor===Object?n[r]=N(o):n[r]=o);return n}function T(t,e){for(;null!==t;){const n=o(t,e);if(n){if(n.get)return k(n.get);if(\"function\"==typeof n.value)return k(n.value)}t=r(t)}function n(){return null}return n}const M=i([\"a\",\"abbr\",\"acronym\",\"address\",\"area\",\"article\",\"aside\",\"audio\",\"b\",\"bdi\",\"bdo\",\"big\",\"blink\",\"blockquote\",\"body\",\"br\",\"button\",\"canvas\",\"caption\",\"center\",\"cite\",\"code\",\"col\",\"colgroup\",\"content\",\"data\",\"datalist\",\"dd\",\"decorator\",\"del\",\"details\",\"dfn\",\"dialog\",\"dir\",\"div\",\"dl\",\"dt\",\"element\",\"em\",\"fieldset\",\"figcaption\",\"figure\",\"font\",\"footer\",\"form\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"head\",\"header\",\"hgroup\",\"hr\",\"html\",\"i\",\"img\",\"input\",\"ins\",\"kbd\",\"label\",\"legend\",\"li\",\"main\",\"map\",\"mark\",\"marquee\",\"menu\",\"menuitem\",\"meter\",\"nav\",\"nobr\",\"ol\",\"optgroup\",\"option\",\"output\",\"p\",\"picture\",\"pre\",\"progress\",\"q\",\"rp\",\"rt\",\"ruby\",\"s\",\"samp\",\"section\",\"select\",\"shadow\",\"small\",\"source\",\"spacer\",\"span\",\"strike\",\"strong\",\"style\",\"sub\",\"summary\",\"sup\",\"table\",\"tbody\",\"td\",\"template\",\"textarea\",\"tfoot\",\"th\",\"thead\",\"time\",\"tr\",\"track\",\"tt\",\"u\",\"ul\",\"var\",\"video\",\"wbr\"]),A=i([\"svg\",\"a\",\"altglyph\",\"altglyphdef\",\"altglyphitem\",\"animatecolor\",\"animatemotion\",\"animatetransform\",\"circle\",\"clippath\",\"defs\",\"desc\",\"ellipse\",\"filter\",\"font\",\"g\",\"glyph\",\"glyphref\",\"hkern\",\"image\",\"line\",\"lineargradient\",\"marker\",\"mask\",\"metadata\",\"mpath\",\"path\",\"pattern\",\"polygon\",\"polyline\",\"radialgradient\",\"rect\",\"stop\",\"style\",\"switch\",\"symbol\",\"text\",\"textpath\",\"title\",\"tref\",\"tspan\",\"view\",\"vkern\"]),S=i([\"feBlend\",\"feColorMatrix\",\"feComponentTransfer\",\"feComposite\",\"feConvolveMatrix\",\"feDiffuseLighting\",\"feDisplacementMap\",\"feDistantLight\",\"feDropShadow\",\"feFlood\",\"feFuncA\",\"feFuncB\",\"feFuncG\",\"feFuncR\",\"feGaussianBlur\",\"feImage\",\"feMerge\",\"feMergeNode\",\"feMorphology\",\"feOffset\",\"fePointLight\",\"feSpecularLighting\",\"feSpotLight\",\"feTile\",\"feTurbulence\"]),C=i([\"animate\",\"color-profile\",\"cursor\",\"discard\",\"font-face\",\"font-face-format\",\"font-face-name\",\"font-face-src\",\"font-face-uri\",\"foreignobject\",\"hatch\",\"hatchpath\",\"mesh\",\"meshgradient\",\"meshpatch\",\"meshrow\",\"missing-glyph\",\"script\",\"set\",\"solidcolor\",\"unknown\",\"use\"]),R=i([\"math\",\"menclose\",\"merror\",\"mfenced\",\"mfrac\",\"mglyph\",\"mi\",\"mlabeledtr\",\"mmultiscripts\",\"mn\",\"mo\",\"mover\",\"mpadded\",\"mphantom\",\"mroot\",\"mrow\",\"ms\",\"mspace\",\"msqrt\",\"mstyle\",\"msub\",\"msup\",\"msubsup\",\"mtable\",\"mtd\",\"mtext\",\"mtr\",\"munder\",\"munderover\",\"mprescripts\"]),D=i([\"maction\",\"maligngroup\",\"malignmark\",\"mlongdiv\",\"mscarries\",\"mscarry\",\"msgroup\",\"mstack\",\"msline\",\"msrow\",\"semantics\",\"annotation\",\"annotation-xml\",\"mprescripts\",\"none\"]),L=i([\"#text\"]),O=i([\"accept\",\"action\",\"align\",\"alt\",\"autocapitalize\",\"autocomplete\",\"autopictureinpicture\",\"autoplay\",\"background\",\"bgcolor\",\"border\",\"capture\",\"cellpadding\",\"cellspacing\",\"checked\",\"cite\",\"class\",\"clear\",\"color\",\"cols\",\"colspan\",\"controls\",\"controlslist\",\"coords\",\"crossorigin\",\"datetime\",\"decoding\",\"default\",\"dir\",\"disabled\",\"disablepictureinpicture\",\"disableremoteplayback\",\"download\",\"draggable\",\"enctype\",\"enterkeyhint\",\"face\",\"for\",\"headers\",\"height\",\"hidden\",\"high\",\"href\",\"hreflang\",\"id\",\"inputmode\",\"integrity\",\"ismap\",\"kind\",\"label\",\"lang\",\"list\",\"loading\",\"loop\",\"low\",\"max\",\"maxlength\",\"media\",\"method\",\"min\",\"minlength\",\"multiple\",\"muted\",\"name\",\"nonce\",\"noshade\",\"novalidate\",\"nowrap\",\"open\",\"optimum\",\"pattern\",\"placeholder\",\"playsinline\",\"popover\",\"popovertarget\",\"popovertargetaction\",\"poster\",\"preload\",\"pubdate\",\"radiogroup\",\"readonly\",\"rel\",\"required\",\"rev\",\"reversed\",\"role\",\"rows\",\"rowspan\",\"spellcheck\",\"scope\",\"selected\",\"shape\",\"size\",\"sizes\",\"span\",\"srclang\",\"start\",\"src\",\"srcset\",\"step\",\"style\",\"summary\",\"tabindex\",\"title\",\"translate\",\"type\",\"usemap\",\"valign\",\"value\",\"width\",\"wrap\",\"xmlns\",\"slot\"]),I=i([\"accent-height\",\"accumulate\",\"additive\",\"alignment-baseline\",\"amplitude\",\"ascent\",\"attributename\",\"attributetype\",\"azimuth\",\"basefrequency\",\"baseline-shift\",\"begin\",\"bias\",\"by\",\"class\",\"clip\",\"clippathunits\",\"clip-path\",\"clip-rule\",\"color\",\"color-interpolation\",\"color-interpolation-filters\",\"color-profile\",\"color-rendering\",\"cx\",\"cy\",\"d\",\"dx\",\"dy\",\"diffuseconstant\",\"direction\",\"display\",\"divisor\",\"dur\",\"edgemode\",\"elevation\",\"end\",\"exponent\",\"fill\",\"fill-opacity\",\"fill-rule\",\"filter\",\"filterunits\",\"flood-color\",\"flood-opacity\",\"font-family\",\"font-size\",\"font-size-adjust\",\"font-stretch\",\"font-style\",\"font-variant\",\"font-weight\",\"fx\",\"fy\",\"g1\",\"g2\",\"glyph-name\",\"glyphref\",\"gradientunits\",\"gradienttransform\",\"height\",\"href\",\"id\",\"image-rendering\",\"in\",\"in2\",\"intercept\",\"k\",\"k1\",\"k2\",\"k3\",\"k4\",\"kerning\",\"keypoints\",\"keysplines\",\"keytimes\",\"lang\",\"lengthadjust\",\"letter-spacing\",\"kernelmatrix\",\"kernelunitlength\",\"lighting-color\",\"local\",\"marker-end\",\"marker-mid\",\"marker-start\",\"markerheight\",\"markerunits\",\"markerwidth\",\"maskcontentunits\",\"maskunits\",\"max\",\"mask\",\"media\",\"method\",\"mode\",\"min\",\"name\",\"numoctaves\",\"offset\",\"operator\",\"opacity\",\"order\",\"orient\",\"orientation\",\"origin\",\"overflow\",\"paint-order\",\"path\",\"pathlength\",\"patterncontentunits\",\"patterntransform\",\"patternunits\",\"points\",\"preservealpha\",\"preserveaspectratio\",\"primitiveunits\",\"r\",\"rx\",\"ry\",\"radius\",\"refx\",\"refy\",\"repeatcount\",\"repeatdur\",\"restart\",\"result\",\"rotate\",\"scale\",\"seed\",\"shape-rendering\",\"slope\",\"specularconstant\",\"specularexponent\",\"spreadmethod\",\"startoffset\",\"stddeviation\",\"stitchtiles\",\"stop-color\",\"stop-opacity\",\"stroke-dasharray\",\"stroke-dashoffset\",\"stroke-linecap\",\"stroke-linejoin\",\"stroke-miterlimit\",\"stroke-opacity\",\"stroke\",\"stroke-width\",\"style\",\"surfacescale\",\"systemlanguage\",\"tabindex\",\"tablevalues\",\"targetx\",\"targety\",\"transform\",\"transform-origin\",\"text-anchor\",\"text-decoration\",\"text-rendering\",\"textlength\",\"type\",\"u1\",\"u2\",\"unicode\",\"values\",\"viewbox\",\"visibility\",\"version\",\"vert-adv-y\",\"vert-origin-x\",\"vert-origin-y\",\"width\",\"word-spacing\",\"wrap\",\"writing-mode\",\"xchannelselector\",\"ychannelselector\",\"x\",\"x1\",\"x2\",\"xmlns\",\"y\",\"y1\",\"y2\",\"z\",\"zoomandpan\"]),z=i([\"accent\",\"accentunder\",\"align\",\"bevelled\",\"close\",\"columnsalign\",\"columnlines\",\"columnspan\",\"denomalign\",\"depth\",\"dir\",\"display\",\"displaystyle\",\"encoding\",\"fence\",\"frame\",\"height\",\"href\",\"id\",\"largeop\",\"length\",\"linethickness\",\"lspace\",\"lquote\",\"mathbackground\",\"mathcolor\",\"mathsize\",\"mathvariant\",\"maxsize\",\"minsize\",\"movablelimits\",\"notation\",\"numalign\",\"open\",\"rowalign\",\"rowlines\",\"rowspacing\",\"rowspan\",\"rspace\",\"rquote\",\"scriptlevel\",\"scriptminsize\",\"scriptsizemultiplier\",\"selection\",\"separator\",\"separators\",\"stretchy\",\"subscriptshift\",\"supscriptshift\",\"symmetric\",\"voffset\",\"width\",\"xmlns\"]),F=i([\"xlink:href\",\"xml:id\",\"xlink:title\",\"xml:space\",\"xmlns:xlink\"]),P=a(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm),U=a(/<%[\\w\\W]*|[\\w\\W]*%>/gm),H=a(/\\${[\\w\\W]*}/gm),j=a(/^data-[\\-\\w.\\u00B7-\\uFFFF]/),q=a(/^aria-[\\-\\w]+$/),B=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i),W=a(/^(?:\\w+script|data):/i),G=a(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g),Y=a(/^html$/i),V=a(/^[a-z][.\\w]*(-[.\\w]+)+$/i);var X=Object.freeze({__proto__:null,MUSTACHE_EXPR:P,ERB_EXPR:U,TMPLIT_EXPR:H,DATA_ATTR:j,ARIA_ATTR:q,IS_ALLOWED_URI:B,IS_SCRIPT_OR_DATA:W,ATTR_WHITESPACE:G,DOCTYPE_NAME:Y,CUSTOM_ELEMENT:V});const J={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},K=function(){return\"undefined\"==typeof window?null:window},Z=function(t,e){if(\"object\"!=typeof t||\"function\"!=typeof t.createPolicy)return null;let n=null;const r=\"data-tt-policy-suffix\";e&&e.hasAttribute(r)&&(n=e.getAttribute(r));const o=\"dompurify\"+(n?\"#\"+n:\"\");try{return t.createPolicy(o,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return console.warn(\"TrustedTypes policy \"+o+\" could not be created.\"),null}};function Q(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:K();const n=t=>Q(t);if(n.version=\"3.1.7\",n.removed=[],!e||!e.document||e.document.nodeType!==J.document)return n.isSupported=!1,n;let{document:r}=e;const o=r,a=o.currentScript,{DocumentFragment:s,HTMLTemplateElement:c,Node:k,Element:_,NodeFilter:E,NamedNodeMap:P=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:U,DOMParser:H,trustedTypes:j}=e,q=_.prototype,W=T(q,\"cloneNode\"),G=T(q,\"remove\"),V=T(q,\"nextSibling\"),tt=T(q,\"childNodes\"),et=T(q,\"parentNode\");if(\"function\"==typeof c){const t=r.createElement(\"template\");t.content&&t.content.ownerDocument&&(r=t.content.ownerDocument)}let nt,rt=\"\";const{implementation:ot,createNodeIterator:it,createDocumentFragment:at,getElementsByTagName:lt}=r,{importNode:st}=o;let ct={};n.isSupported=\"function\"==typeof t&&\"function\"==typeof et&&ot&&void 0!==ot.createHTMLDocument;const{MUSTACHE_EXPR:ut,ERB_EXPR:dt,TMPLIT_EXPR:pt,DATA_ATTR:ft,ARIA_ATTR:mt,IS_SCRIPT_OR_DATA:gt,ATTR_WHITESPACE:ht,CUSTOM_ELEMENT:bt}=X;let{IS_ALLOWED_URI:yt}=X,wt=null;const xt=$({},[...M,...A,...S,...R,...L]);let vt=null;const kt=$({},[...O,...I,...z,...F]);let _t=Object.seal(l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$t=null,Et=null,Nt=!0,Tt=!0,Mt=!1,At=!0,St=!1,Ct=!0,Rt=!1,Dt=!1,Lt=!1,Ot=!1,It=!1,zt=!1,Ft=!0,Pt=!1;const Ut=\"user-content-\";let Ht=!0,jt=!1,qt={},Bt=null;const Wt=$({},[\"annotation-xml\",\"audio\",\"colgroup\",\"desc\",\"foreignobject\",\"head\",\"iframe\",\"math\",\"mi\",\"mn\",\"mo\",\"ms\",\"mtext\",\"noembed\",\"noframes\",\"noscript\",\"plaintext\",\"script\",\"style\",\"svg\",\"template\",\"thead\",\"title\",\"video\",\"xmp\"]);let Gt=null;const Yt=$({},[\"audio\",\"video\",\"img\",\"source\",\"image\",\"track\"]);let Vt=null;const Xt=$({},[\"alt\",\"class\",\"for\",\"id\",\"label\",\"name\",\"pattern\",\"placeholder\",\"role\",\"summary\",\"title\",\"value\",\"style\",\"xmlns\"]),Jt=\"http://www.w3.org/1998/Math/MathML\",Kt=\"http://www.w3.org/2000/svg\",Zt=\"http://www.w3.org/1999/xhtml\";let Qt=Zt,te=!1,ee=null;const ne=$({},[Jt,Kt,Zt],m);let re=null;const oe=[\"application/xhtml+xml\",\"text/html\"],ie=\"text/html\";let ae=null,le=null;const se=r.createElement(\"form\"),ce=function(t){return t instanceof RegExp||t instanceof Function},ue=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!le||le!==t){if(t&&\"object\"==typeof t||(t={}),t=N(t),re=-1===oe.indexOf(t.PARSER_MEDIA_TYPE)?ie:t.PARSER_MEDIA_TYPE,ae=\"application/xhtml+xml\"===re?m:f,wt=w(t,\"ALLOWED_TAGS\")?$({},t.ALLOWED_TAGS,ae):xt,vt=w(t,\"ALLOWED_ATTR\")?$({},t.ALLOWED_ATTR,ae):kt,ee=w(t,\"ALLOWED_NAMESPACES\")?$({},t.ALLOWED_NAMESPACES,m):ne,Vt=w(t,\"ADD_URI_SAFE_ATTR\")?$(N(Xt),t.ADD_URI_SAFE_ATTR,ae):Xt,Gt=w(t,\"ADD_DATA_URI_TAGS\")?$(N(Yt),t.ADD_DATA_URI_TAGS,ae):Yt,Bt=w(t,\"FORBID_CONTENTS\")?$({},t.FORBID_CONTENTS,ae):Wt,$t=w(t,\"FORBID_TAGS\")?$({},t.FORBID_TAGS,ae):{},Et=w(t,\"FORBID_ATTR\")?$({},t.FORBID_ATTR,ae):{},qt=!!w(t,\"USE_PROFILES\")&&t.USE_PROFILES,Nt=!1!==t.ALLOW_ARIA_ATTR,Tt=!1!==t.ALLOW_DATA_ATTR,Mt=t.ALLOW_UNKNOWN_PROTOCOLS||!1,At=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,St=t.SAFE_FOR_TEMPLATES||!1,Ct=!1!==t.SAFE_FOR_XML,Rt=t.WHOLE_DOCUMENT||!1,Ot=t.RETURN_DOM||!1,It=t.RETURN_DOM_FRAGMENT||!1,zt=t.RETURN_TRUSTED_TYPE||!1,Lt=t.FORCE_BODY||!1,Ft=!1!==t.SANITIZE_DOM,Pt=t.SANITIZE_NAMED_PROPS||!1,Ht=!1!==t.KEEP_CONTENT,jt=t.IN_PLACE||!1,yt=t.ALLOWED_URI_REGEXP||B,Qt=t.NAMESPACE||Zt,_t=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&ce(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(_t.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&ce(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(_t.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&\"boolean\"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(_t.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),St&&(Tt=!1),It&&(Ot=!0),qt&&(wt=$({},L),vt=[],!0===qt.html&&($(wt,M),$(vt,O)),!0===qt.svg&&($(wt,A),$(vt,I),$(vt,F)),!0===qt.svgFilters&&($(wt,S),$(vt,I),$(vt,F)),!0===qt.mathMl&&($(wt,R),$(vt,z),$(vt,F))),t.ADD_TAGS&&(wt===xt&&(wt=N(wt)),$(wt,t.ADD_TAGS,ae)),t.ADD_ATTR&&(vt===kt&&(vt=N(vt)),$(vt,t.ADD_ATTR,ae)),t.ADD_URI_SAFE_ATTR&&$(Vt,t.ADD_URI_SAFE_ATTR,ae),t.FORBID_CONTENTS&&(Bt===Wt&&(Bt=N(Bt)),$(Bt,t.FORBID_CONTENTS,ae)),Ht&&(wt[\"#text\"]=!0),Rt&&$(wt,[\"html\",\"head\",\"body\"]),wt.table&&($(wt,[\"tbody\"]),delete $t.tbody),t.TRUSTED_TYPES_POLICY){if(\"function\"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw v('TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.');if(\"function\"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw v('TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.');nt=t.TRUSTED_TYPES_POLICY,rt=nt.createHTML(\"\")}else void 0===nt&&(nt=Z(j,a)),null!==nt&&\"string\"==typeof rt&&(rt=nt.createHTML(\"\"));i&&i(t),le=t}},de=$({},[\"mi\",\"mo\",\"mn\",\"ms\",\"mtext\"]),pe=$({},[\"annotation-xml\"]),fe=$({},[\"title\",\"style\",\"font\",\"a\",\"script\"]),me=$({},[...A,...S,...C]),ge=$({},[...R,...D]),he=function(t){let e=et(t);e&&e.tagName||(e={namespaceURI:Qt,tagName:\"template\"});const n=f(t.tagName),r=f(e.tagName);return!!ee[t.namespaceURI]&&(t.namespaceURI===Kt?e.namespaceURI===Zt?\"svg\"===n:e.namespaceURI===Jt?\"svg\"===n&&(\"annotation-xml\"===r||de[r]):Boolean(me[n]):t.namespaceURI===Jt?e.namespaceURI===Zt?\"math\"===n:e.namespaceURI===Kt?\"math\"===n&&pe[r]:Boolean(ge[n]):t.namespaceURI===Zt?!(e.namespaceURI===Kt&&!pe[r])&&!(e.namespaceURI===Jt&&!de[r])&&!ge[n]&&(fe[n]||!me[n]):!(\"application/xhtml+xml\"!==re||!ee[t.namespaceURI]))},be=function(t){p(n.removed,{element:t});try{et(t).removeChild(t)}catch(e){G(t)}},ye=function(t,e){try{p(n.removed,{attribute:e.getAttributeNode(t),from:e})}catch(t){p(n.removed,{attribute:null,from:e})}if(e.removeAttribute(t),\"is\"===t&&!vt[t])if(Ot||It)try{be(e)}catch(t){}else try{e.setAttribute(t,\"\")}catch(t){}},we=function(t){let e=null,n=null;if(Lt)t=\"<remove></remove>\"+t;else{const e=g(t,/^[\\r\\n\\t ]+/);n=e&&e[0]}\"application/xhtml+xml\"===re&&Qt===Zt&&(t='<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>'+t+\"</body></html>\");const o=nt?nt.createHTML(t):t;if(Qt===Zt)try{e=(new H).parseFromString(o,re)}catch(t){}if(!e||!e.documentElement){e=ot.createDocument(Qt,\"template\",null);try{e.documentElement.innerHTML=te?rt:o}catch(t){}}const i=e.body||e.documentElement;return t&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),Qt===Zt?lt.call(e,Rt?\"html\":\"body\")[0]:Rt?e.documentElement:i},xe=function(t){return it.call(t.ownerDocument||t,t,E.SHOW_ELEMENT|E.SHOW_COMMENT|E.SHOW_TEXT|E.SHOW_PROCESSING_INSTRUCTION|E.SHOW_CDATA_SECTION,null)},ve=function(t){return t instanceof U&&(\"string\"!=typeof t.nodeName||\"string\"!=typeof t.textContent||\"function\"!=typeof t.removeChild||!(t.attributes instanceof P)||\"function\"!=typeof t.removeAttribute||\"function\"!=typeof t.setAttribute||\"string\"!=typeof t.namespaceURI||\"function\"!=typeof t.insertBefore||\"function\"!=typeof t.hasChildNodes)},ke=function(t){return\"function\"==typeof k&&t instanceof k},_e=function(t,e,r){ct[t]&&u(ct[t],(t=>{t.call(n,e,r,le)}))},$e=function(t){let e=null;if(_e(\"beforeSanitizeElements\",t,null),ve(t))return be(t),!0;const r=ae(t.nodeName);if(_e(\"uponSanitizeElement\",t,{tagName:r,allowedTags:wt}),t.hasChildNodes()&&!ke(t.firstElementChild)&&x(/<[/\\w]/g,t.innerHTML)&&x(/<[/\\w]/g,t.textContent))return be(t),!0;if(t.nodeType===J.progressingInstruction)return be(t),!0;if(Ct&&t.nodeType===J.comment&&x(/<[/\\w]/g,t.data))return be(t),!0;if(!wt[r]||$t[r]){if(!$t[r]&&Ne(r)){if(_t.tagNameCheck instanceof RegExp&&x(_t.tagNameCheck,r))return!1;if(_t.tagNameCheck instanceof Function&&_t.tagNameCheck(r))return!1}if(Ht&&!Bt[r]){const e=et(t)||t.parentNode,n=tt(t)||t.childNodes;if(n&&e)for(let r=n.length-1;r>=0;--r){const o=W(n[r],!0);o.__removalCount=(t.__removalCount||0)+1,e.insertBefore(o,V(t))}}return be(t),!0}return t instanceof _&&!he(t)?(be(t),!0):\"noscript\"!==r&&\"noembed\"!==r&&\"noframes\"!==r||!x(/<\\/no(script|embed|frames)/i,t.innerHTML)?(St&&t.nodeType===J.text&&(e=t.textContent,u([ut,dt,pt],(t=>{e=h(e,t,\" \")})),t.textContent!==e&&(p(n.removed,{element:t.cloneNode()}),t.textContent=e)),_e(\"afterSanitizeElements\",t,null),!1):(be(t),!0)},Ee=function(t,e,n){if(Ft&&(\"id\"===e||\"name\"===e)&&(n in r||n in se))return!1;if(Tt&&!Et[e]&&x(ft,e));else if(Nt&&x(mt,e));else if(!vt[e]||Et[e]){if(!(Ne(t)&&(_t.tagNameCheck instanceof RegExp&&x(_t.tagNameCheck,t)||_t.tagNameCheck instanceof Function&&_t.tagNameCheck(t))&&(_t.attributeNameCheck instanceof RegExp&&x(_t.attributeNameCheck,e)||_t.attributeNameCheck instanceof Function&&_t.attributeNameCheck(e))||\"is\"===e&&_t.allowCustomizedBuiltInElements&&(_t.tagNameCheck instanceof RegExp&&x(_t.tagNameCheck,n)||_t.tagNameCheck instanceof Function&&_t.tagNameCheck(n))))return!1}else if(Vt[e]);else if(x(yt,h(n,ht,\"\")));else if(\"src\"!==e&&\"xlink:href\"!==e&&\"href\"!==e||\"script\"===t||0!==b(n,\"data:\")||!Gt[t])if(Mt&&!x(gt,h(n,ht,\"\")));else if(n)return!1;return!0},Ne=function(t){return\"annotation-xml\"!==t&&g(t,bt)},Te=function(t){_e(\"beforeSanitizeAttributes\",t,null);const{attributes:e}=t;if(!e)return;const r={attrName:\"\",attrValue:\"\",keepAttr:!0,allowedAttributes:vt};let o=e.length;for(;o--;){const i=e[o],{name:a,namespaceURI:l,value:s}=i,c=ae(a);let p=\"value\"===a?s:y(s);if(r.attrName=c,r.attrValue=p,r.keepAttr=!0,r.forceKeepAttr=void 0,_e(\"uponSanitizeAttribute\",t,r),p=r.attrValue,r.forceKeepAttr)continue;if(ye(a,t),!r.keepAttr)continue;if(!At&&x(/\\/>/i,p)){ye(a,t);continue}St&&u([ut,dt,pt],(t=>{p=h(p,t,\" \")}));const f=ae(t.nodeName);if(Ee(f,c,p))if(!Pt||\"id\"!==c&&\"name\"!==c||(ye(a,t),p=Ut+p),Ct&&x(/((--!?|])>)|<\\/(style|title)/i,p))ye(a,t);else{if(nt&&\"object\"==typeof j&&\"function\"==typeof j.getAttributeType)if(l);else switch(j.getAttributeType(f,c)){case\"TrustedHTML\":p=nt.createHTML(p);break;case\"TrustedScriptURL\":p=nt.createScriptURL(p)}try{l?t.setAttributeNS(l,a,p):t.setAttribute(a,p),ve(t)?be(t):d(n.removed)}catch(t){}}}_e(\"afterSanitizeAttributes\",t,null)},Me=function t(e){let n=null;const r=xe(e);for(_e(\"beforeSanitizeShadowDOM\",e,null);n=r.nextNode();)_e(\"uponSanitizeShadowNode\",n,null),$e(n)||(n.content instanceof s&&t(n.content),Te(n));_e(\"afterSanitizeShadowDOM\",e,null)};return n.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,a=null,l=null;if(te=!t,te&&(t=\"\\x3c!--\\x3e\"),\"string\"!=typeof t&&!ke(t)){if(\"function\"!=typeof t.toString)throw v(\"toString is not a function\");if(\"string\"!=typeof(t=t.toString()))throw v(\"dirty is not a string, aborting\")}if(!n.isSupported)return t;if(Dt||ue(e),n.removed=[],\"string\"==typeof t&&(jt=!1),jt){if(t.nodeName){const e=ae(t.nodeName);if(!wt[e]||$t[e])throw v(\"root node is forbidden and cannot be sanitized in-place\")}}else if(t instanceof k)r=we(\"\\x3c!----\\x3e\"),i=r.ownerDocument.importNode(t,!0),i.nodeType===J.element&&\"BODY\"===i.nodeName||\"HTML\"===i.nodeName?r=i:r.appendChild(i);else{if(!Ot&&!St&&!Rt&&-1===t.indexOf(\"<\"))return nt&&zt?nt.createHTML(t):t;if(r=we(t),!r)return Ot?null:zt?rt:\"\"}r&&Lt&&be(r.firstChild);const c=xe(jt?t:r);for(;a=c.nextNode();)$e(a)||(a.content instanceof s&&Me(a.content),Te(a));if(jt)return t;if(Ot){if(It)for(l=at.call(r.ownerDocument);r.firstChild;)l.appendChild(r.firstChild);else l=r;return(vt.shadowroot||vt.shadowrootmode)&&(l=st.call(o,l,!0)),l}let d=Rt?r.outerHTML:r.innerHTML;return Rt&&wt[\"!doctype\"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&x(Y,r.ownerDocument.doctype.name)&&(d=\"<!DOCTYPE \"+r.ownerDocument.doctype.name+\">\\n\"+d),St&&u([ut,dt,pt],(t=>{d=h(d,t,\" \")})),nt&&zt?nt.createHTML(d):d},n.setConfig=function(){ue(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Dt=!0},n.clearConfig=function(){le=null,Dt=!1},n.isValidAttribute=function(t,e,n){le||ue({});const r=ae(t),o=ae(e);return Ee(r,o,n)},n.addHook=function(t,e){\"function\"==typeof e&&(ct[t]=ct[t]||[],p(ct[t],e))},n.removeHook=function(t){if(ct[t])return d(ct[t])},n.removeHooks=function(t){ct[t]&&(ct[t]=[])},n.removeAllHooks=function(){ct={}},n}var tt=Q();return tt}();var Lt=Rt(Dt.exports);function Ot(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]=\"#\"+t.slice(6*r,6*++r);return n}function It(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function zt(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Ft(){}var Pt=.7,Ut=1/Pt,Ht=\"\\\\s*([+-]?\\\\d+)\\\\s*\",jt=\"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",qt=\"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",Bt=/^#([0-9a-f]{3,8})$/,Wt=new RegExp(`^rgb\\\\(${Ht},${Ht},${Ht}\\\\)$`),Gt=new RegExp(`^rgb\\\\(${qt},${qt},${qt}\\\\)$`),Yt=new RegExp(`^rgba\\\\(${Ht},${Ht},${Ht},${jt}\\\\)$`),Vt=new RegExp(`^rgba\\\\(${qt},${qt},${qt},${jt}\\\\)$`),Xt=new RegExp(`^hsl\\\\(${jt},${qt},${qt}\\\\)$`),Jt=new RegExp(`^hsla\\\\(${jt},${qt},${qt},${jt}\\\\)$`),Kt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Zt(){return this.rgb().formatHex()}function Qt(){return this.rgb().formatRgb()}function te(t){var e,n;return t=(t+\"\").trim().toLowerCase(),(e=Bt.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?ee(e):3===n?new oe(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?ne(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?ne(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Wt.exec(t))?new oe(e[1],e[2],e[3],1):(e=Gt.exec(t))?new oe(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Yt.exec(t))?ne(e[1],e[2],e[3],e[4]):(e=Vt.exec(t))?ne(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Xt.exec(t))?ue(e[1],e[2]/100,e[3]/100,1):(e=Jt.exec(t))?ue(e[1],e[2]/100,e[3]/100,e[4]):Kt.hasOwnProperty(t)?ee(Kt[t]):\"transparent\"===t?new oe(NaN,NaN,NaN,0):null}function ee(t){return new oe(t>>16&255,t>>8&255,255&t,1)}function ne(t,e,n,r){return r<=0&&(t=e=n=NaN),new oe(t,e,n,r)}function re(t,e,n,r){return 1===arguments.length?((o=t)instanceof Ft||(o=te(o)),o?new oe((o=o.rgb()).r,o.g,o.b,o.opacity):new oe):new oe(t,e,n,null==r?1:r);var o}function oe(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function ie(){return`#${ce(this.r)}${ce(this.g)}${ce(this.b)}`}function ae(){const t=le(this.opacity);return`${1===t?\"rgb(\":\"rgba(\"}${se(this.r)}, ${se(this.g)}, ${se(this.b)}${1===t?\")\":`, ${t})`}`}function le(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function se(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ce(t){return((t=se(t))<16?\"0\":\"\")+t.toString(16)}function ue(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new pe(t,e,n,r)}function de(t){if(t instanceof pe)return new pe(t.h,t.s,t.l,t.opacity);if(t instanceof Ft||(t=te(t)),!t)return new pe;if(t instanceof pe)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,o=Math.min(e,n,r),i=Math.max(e,n,r),a=NaN,l=i-o,s=(i+o)/2;return l?(a=e===i?(n-r)/l+6*(n<r):n===i?(r-e)/l+2:(e-n)/l+4,l/=s<.5?i+o:2-i-o,a*=60):l=s>0&&s<1?0:a,new pe(a,l,s,t.opacity)}function pe(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function fe(t){return(t=(t||0)%360)<0?t+360:t}function me(t){return Math.max(0,Math.min(1,t||0))}function ge(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}It(Ft,te,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Zt,formatHex:Zt,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return de(this).formatHsl()},formatRgb:Qt,toString:Qt}),It(oe,re,zt(Ft,{brighter(t){return t=null==t?Ut:Math.pow(Ut,t),new oe(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Pt:Math.pow(Pt,t),new oe(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new oe(se(this.r),se(this.g),se(this.b),le(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ie,formatHex:ie,formatHex8:function(){return`#${ce(this.r)}${ce(this.g)}${ce(this.b)}${ce(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:ae,toString:ae})),It(pe,(function(t,e,n,r){return 1===arguments.length?de(t):new pe(t,e,n,null==r?1:r)}),zt(Ft,{brighter(t){return t=null==t?Ut:Math.pow(Ut,t),new pe(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Pt:Math.pow(Pt,t),new pe(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,o=2*n-r;return new oe(ge(t>=240?t-240:t+120,o,r),ge(t,o,r),ge(t<120?t+240:t-120,o,r),this.opacity)},clamp(){return new pe(fe(this.h),me(this.s),me(this.l),le(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=le(this.opacity);return`${1===t?\"hsl(\":\"hsla(\"}${fe(this.h)}, ${100*me(this.s)}%, ${100*me(this.l)}%${1===t?\")\":`, ${t})`}`}}));var he=t=>()=>t;function be(t){return 1==(t=+t)?ye:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):he(isNaN(e)?n:e)}}function ye(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):he(isNaN(t)?e:t)}var we=function t(e){var n=be(e);function r(t,e){var r=n((t=re(t)).r,(e=re(e)).r),o=n(t.g,e.g),i=n(t.b,e.b),a=ye(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=o(e),t.b=i(e),t.opacity=a(e),t+\"\"}}return r.gamma=t,r}(1);var xe,ve=(xe=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),o=t[r],i=t[r+1],a=r>0?t[r-1]:2*o-i,l=r<e-1?t[r+2]:2*i-o;return function(t,e,n,r,o){var i=t*t,a=i*t;return((1-3*t+3*i-a)*e+(4-6*i+3*a)*n+(1+3*t+3*i-3*a)*r+a*o)/6}((n-r/e)*e,a,o,i,l)}},function(t){var e,n,r=t.length,o=new Array(r),i=new Array(r),a=new Array(r);for(e=0;e<r;++e)n=re(t[e]),o[e]=n.r||0,i[e]=n.g||0,a[e]=n.b||0;return o=xe(o),i=xe(i),a=xe(a),n.opacity=1,function(t){return n.r=o(t),n.g=i(t),n.b=a(t),n+\"\"}});function ke(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,o=e.slice();return function(i){for(n=0;n<r;++n)o[n]=t[n]*(1-i)+e[n]*i;return o}}function _e(t,e){var n,r=e?e.length:0,o=t?Math.min(r,t.length):0,i=new Array(o),a=new Array(r);for(n=0;n<o;++n)i[n]=Se(t[n],e[n]);for(;n<r;++n)a[n]=e[n];return function(t){for(n=0;n<o;++n)a[n]=i[n](t);return a}}function $e(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function Ee(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Ne(t,e){var n,r={},o={};for(n in null!==t&&\"object\"==typeof t||(t={}),null!==e&&\"object\"==typeof e||(e={}),e)n in t?r[n]=Se(t[n],e[n]):o[n]=e[n];return function(t){for(n in r)o[n]=r[n](t);return o}}var Te=/[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,Me=new RegExp(Te.source,\"g\");function Ae(t,e){var n,r,o,i=Te.lastIndex=Me.lastIndex=0,a=-1,l=[],s=[];for(t+=\"\",e+=\"\";(n=Te.exec(t))&&(r=Me.exec(e));)(o=r.index)>i&&(o=e.slice(i,o),l[a]?l[a]+=o:l[++a]=o),(n=n[0])===(r=r[0])?l[a]?l[a]+=r:l[++a]=r:(l[++a]=null,s.push({i:a,x:Ee(n,r)})),i=Me.lastIndex;return i<e.length&&(o=e.slice(i),l[a]?l[a]+=o:l[++a]=o),l.length<2?s[0]?function(t){return function(e){return t(e)+\"\"}}(s[0].x):function(t){return function(){return t}}(e):(e=s.length,function(t){for(var n,r=0;r<e;++r)l[(n=s[r]).i]=n.x(t);return l.join(\"\")})}function Se(t,e){var n,r,o=typeof e;return null==e||\"boolean\"===o?he(e):(\"number\"===o?Ee:\"string\"===o?(n=te(e))?(e=n,we):Ae:e instanceof te?we:e instanceof Date?$e:(r=e,!ArrayBuffer.isView(r)||r instanceof DataView?Array.isArray(e)?_e:\"function\"!=typeof e.valueOf&&\"function\"!=typeof e.toString||isNaN(e)?Ne:Ee:ke))(t,e)}function Ce(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var Re=t=>ve(t[t.length-1]),De=Re(new Array(3).concat(\"deebf79ecae13182bd\",\"eff3ffbdd7e76baed62171b5\",\"eff3ffbdd7e76baed63182bd08519c\",\"eff3ffc6dbef9ecae16baed63182bd08519c\",\"eff3ffc6dbef9ecae16baed64292c62171b5084594\",\"f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594\",\"f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b\").map(Ot)),Le=Re(new Array(3).concat(\"e5f5e0a1d99b31a354\",\"edf8e9bae4b374c476238b45\",\"edf8e9bae4b374c47631a354006d2c\",\"edf8e9c7e9c0a1d99b74c47631a354006d2c\",\"edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32\",\"f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32\",\"f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b\").map(Ot));function Oe(t,e,n){const r=t.slice();return r[40]=e[n],r[42]=n,r}function Ie(t,e,n){const r=t.slice();return r[43]=e[n],r}function ze(t,e,n){const r=t.slice();return r[46]=e[n],r[42]=n,r}function Fe(e){let n;return{c(){n=h(\"div\"),n.textContent=\"Missing tokens will show on completion.\",k(n,\"class\",\"text-sm border-b text-red-700\")},m(t,e){f(t,n,e)},p:t,i:t,o:t,d(t){t&&m(n)}}}function Pe(t){let e,n,r,o,i,a,l,s,c,u;o=new St({props:{token:t[13],index:-1,underlineStyle:t[8](t[13]),bgStyle:t[9](t[13])}});let d=\"None\"!==t[2]&&Ue(t),g=\"None\"!==t[3]&&He(t),b=void 0!==t[13].top_k&&je(t);return{c(){e=h(\"div\"),n=h(\"div\"),r=h(\"div\"),Z(o.$$.fragment),i=w(),a=h(\"table\"),l=h(\"tbody\"),d&&d.c(),s=w(),g&&g.c(),c=w(),b&&b.c(),k(r,\"class\",\"mb-5 mt-1\"),k(l,\"class\",\"text-xs tracking-wider\"),k(a,\"class\",\"w-full\"),k(n,\"class\",\"text-2xl px-1 pb-1 text-left w-full bg-white\"),k(e,\"class\",\"col-1 flex flex-col items-center\")},m(t,m){f(t,e,m),p(e,n),p(n,r),Q(o,r,null),p(n,i),p(n,a),p(a,l),d&&d.m(l,null),p(l,s),g&&g.m(l,null),p(e,c),b&&b.m(e,null),u=!0},p(t,n){const r={};8192&n[0]&&(r.token=t[13]),8448&n[0]&&(r.underlineStyle=t[8](t[13])),8704&n[0]&&(r.bgStyle=t[9](t[13])),o.$set(r),\"None\"!==t[2]?d?d.p(t,n):(d=Ue(t),d.c(),d.m(l,s)):d&&(d.d(1),d=null),\"None\"!==t[3]?g?g.p(t,n):(g=He(t),g.c(),g.m(l,null)):g&&(g.d(1),g=null),void 0!==t[13].top_k?b?b.p(t,n):(b=je(t),b.c(),b.m(e,null)):b&&(b.d(1),b=null)},i(t){u||(X(o.$$.fragment,t),u=!0)},o(t){J(o.$$.fragment,t),u=!1},d(t){t&&m(e),tt(o),d&&d.d(),g&&g.d(),b&&b.d()}}}function Ue(t){let e,n,r,o,i,a,l,s,c,u=t[14](t[13],t[2])+\"\";return{c(){e=h(\"tr\"),n=h(\"td\"),r=h(\"span\"),o=y(t[2]),a=w(),l=h(\"td\"),s=h(\"span\"),c=y(u),k(r,\"style\",i=t[9](t[13])),k(s,\"class\",\"pl-1\"),k(l,\"class\",\"text-right\")},m(t,i){f(t,e,i),p(e,n),p(n,r),p(r,o),p(e,a),p(e,l),p(l,s),p(s,c)},p(t,e){4&e[0]&&_(o,t[2]),8704&e[0]&&i!==(i=t[9](t[13]))&&k(r,\"style\",i),8196&e[0]&&u!==(u=t[14](t[13],t[2])+\"\")&&_(c,u)},d(t){t&&m(e)}}}function He(t){let e,n,r,o,i,a,l,s,c,u=t[14](t[13],t[3])+\"\";return{c(){e=h(\"tr\"),n=h(\"td\"),r=h(\"span\"),o=y(t[3]),a=w(),l=h(\"td\"),s=h(\"span\"),c=y(u),k(r,\"class\",\"border-b-2\"),k(r,\"style\",i=t[8](t[13])),k(l,\"class\",\"text-right\")},m(t,i){f(t,e,i),p(e,n),p(n,r),p(r,o),p(e,a),p(e,l),p(l,s),p(s,c)},p(t,e){8&e[0]&&_(o,t[3]),8448&e[0]&&i!==(i=t[8](t[13]))&&k(r,\"style\",i),8200&e[0]&&u!==(u=t[14](t[13],t[3])+\"\")&&_(c,u)},d(t){t&&m(e)}}}function je(t){let e,n,r,o,i,a,l=K(t[13].top_k),s=[];for(let e=0;e<l.length;e+=1)s[e]=qe(ze(t,l,e));return{c(){e=h(\"hr\"),n=w(),r=h(\"table\"),o=h(\"thead\"),o.innerHTML='<tr><th class=\"px-1 pb-1 font-normal text-xs text-left text-gray-700 tracking-wide\">Candidate</th> <th class=\"px-1 pb-1 font-normal text-xs text-right text-gray-700 tracking-wide\">Prob</th></tr>',i=w(),a=h(\"tbody\");for(let t=0;t<s.length;t+=1)s[t].c();k(e,\"class\",\"bg-gray-400 w-full my-2\"),k(r,\"class\",\"w-full\")},m(t,l){f(t,e,l),f(t,n,l),f(t,r,l),p(r,o),p(r,i),p(r,a);for(let t=0;t<s.length;t+=1)s[t]&&s[t].m(a,null)},p(t,e){if(1056768&e[0]){let n;for(l=K(t[13].top_k),n=0;n<l.length;n+=1){const r=ze(t,l,n);s[n]?s[n].p(r,e):(s[n]=qe(r),s[n].c(),s[n].m(a,null))}for(;n<s.length;n+=1)s[n].d(1);s.length=l.length}},d(t){t&&(m(e),m(n),m(r)),g(s,t)}}}function qe(t){let e,n,r,o,i,a,l,s,c,u=t[20](t[46].text)+\"\",d=t[46].prob.toFixed(3)+\"\";return{c(){e=h(\"tr\"),n=h(\"td\"),r=h(\"span\"),i=w(),a=h(\"td\"),l=y(d),c=w(),k(r,\"class\",\"bg-gray-200\"),k(n,\"class\",o=\"px-1 text-left font-mono text-sm decoration-2 \"+(t[46].is_masked?\"line-through\":\"\")),k(a,\"class\",s=\"px-1 text-right font-mono text-sm decoration-2 \"+(t[46].is_masked?\"line-through\":\"\")),k(e,\"class\",\"\"+(5===t[42]?\"border-t border-dashed border-gray-300\":\"\"))},m(t,o){f(t,e,o),p(e,n),p(n,r),r.innerHTML=u,p(e,i),p(e,a),p(a,l),p(e,c)},p(t,e){8192&e[0]&&u!==(u=t[20](t[46].text)+\"\")&&(r.innerHTML=u),8192&e[0]&&o!==(o=\"px-1 text-left font-mono text-sm decoration-2 \"+(t[46].is_masked?\"line-through\":\"\"))&&k(n,\"class\",o),8192&e[0]&&d!==(d=t[46].prob.toFixed(3)+\"\")&&_(l,d),8192&e[0]&&s!==(s=\"px-1 text-right font-mono text-sm decoration-2 \"+(t[46].is_masked?\"line-through\":\"\"))&&k(a,\"class\",s)},d(t){t&&m(e)}}}function Be(e){let n,r,o,i;return n=new St({props:{token:e[21],index:-1}}),{c(){Z(n.$$.fragment),r=w(),o=h(\"div\"),k(o,\"class\",\"basis-full h-2\")},m(t,e){Q(n,t,e),f(t,r,e),f(t,o,e),i=!0},p:t,i(t){i||(X(n.$$.fragment,t),i=!0)},o(t){J(n.$$.fragment,t),i=!1},d(t){t&&(m(r),m(o)),tt(n,t)}}}function We(t){let e;let n=function(t){return 0===t[42]?Ye:Ge}(t),r=n(t);return{c(){r.c(),e=x()},m(t,n){r.m(t,n),f(t,e,n)},d(t){t&&m(e),r.d(t)}}}function Ge(t){let e,n,r=K({length:2}),o=[];for(let e=0;e<r.length;e+=1)o[e]=Ve(Ie(t,r,e));return{c(){for(let t=0;t<o.length;t+=1)o[t].c();e=w(),n=h(\"div\"),k(n,\"class\",\"basis-full h-0\")},m(t,r){for(let e=0;e<o.length;e+=1)o[e]&&o[e].m(t,r);f(t,e,r),f(t,n,r)},d(t){t&&(m(e),m(n)),g(o,t)}}}function Ye(t){let e;return{c(){e=h(\"div\"),k(e,\"class\",\"basis-full h-2\")},m(t,n){f(t,e,n)},d(t){t&&m(e)}}}function Ve(e){let n,r,o;return{c(){n=h(\"div\"),r=w(),o=h(\"span\"),o.textContent=\" \",k(n,\"class\",\"basis-full h-0\"),k(o,\"class\",\"inline-block\")},m(t,e){f(t,n,e),f(t,r,e),f(t,o,e)},p:t,d(t){t&&(m(n),m(r),m(o))}}}function Xe(t){let e,n,r,o=!0===t[40].special&&\"\"!==t[40].role&&We(t);return n=new St({props:{token:t[40],index:t[42],underlineStyle:t[8](t[40]),bgStyle:t[9](t[40])}}),{c(){o&&o.c(),e=w(),Z(n.$$.fragment)},m(t,i){o&&o.m(t,i),f(t,e,i),Q(n,t,i),r=!0},p(t,r){!0===t[40].special&&\"\"!==t[40].role?o||(o=We(t),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null);const i={};128&r[0]&&(i.token=t[40]),384&r[0]&&(i.underlineStyle=t[8](t[40])),640&r[0]&&(i.bgStyle=t[9](t[40])),n.$set(i)},i(t){r||(X(n.$$.fragment,t),r=!0)},o(t){J(n.$$.fragment,t),r=!1},d(t){t&&m(e),o&&o.d(t),tt(n,t)}}}function Je(t){let e;return{c(){e=h(\"span\"),e.textContent=\" \",k(e,\"class\",\"inline-block mt-2 border-b-2 border-white bg-gray-700 animate-cpulse\")},m(t,n){f(t,e,n)},d(t){t&&m(e)}}}function Ke(t){let e,n,r;return n=new vt({props:{audioData:t[4].value}}),{c(){e=h(\"div\"),Z(n.$$.fragment),k(e,\"class\",\"my-3\")},m(t,o){f(t,e,o),Q(n,e,null),r=!0},p(t,e){const r={};16&e[0]&&(r.audioData=t[4].value),n.$set(r)},i(t){r||(X(n.$$.fragment,t),r=!0)},o(t){J(n.$$.fragment,t),r=!1},d(t){t&&m(e),tt(n)}}}function Ze(t){let e,n,r,o;return{c(){e=h(\"div\"),n=h(\"video\"),r=h(\"source\"),l(r.src,o=`data:video/mp4;base64,${t[6].value}`)||k(r,\"src\",o),k(r,\"type\",\"video/mp4\"),n.controls=!0,k(e,\"class\",\"my-3\")},m(t,o){f(t,e,o),p(e,n),p(n,r)},p(t,e){64&e[0]&&!l(r.src,o=`data:video/mp4;base64,${t[6].value}`)&&k(r,\"src\",o)},d(t){t&&m(e)}}}function Qe(t){let e,n,r;return{c(){e=h(\"div\"),n=h(\"img\"),l(n.src,r=`data:image/png;base64,${t[5].value}`)||k(n,\"src\",r),k(n,\"alt\",\"Image output\"),k(e,\"class\",\"my-3\")},m(t,r){f(t,e,r),p(e,n)},p(t,e){32&e[0]&&!l(n.src,r=`data:image/png;base64,${t[5].value}`)&&k(n,\"src\",r)},d(t){t&&m(e)}}}function tn(t){let e,n,o,i,a,l,s,c,d,b,y,x,_,$,N,T;const M=[Pe,Fe],A=[];function S(t,e){return t[13]?0:1}o=S(t),i=A[o]=M[o](t);let C=t[1]&&Be(t),R=K(t[7]),D=[];for(let e=0;e<R.length;e+=1)D[e]=Xe(Oe(t,R,e));const L=t=>J(D[t],1,1,(()=>{D[t]=null}));let O=!1===t[0]&&Je(),I=null!==t[4]&&Ke(t),z=null!==t[6]&&Ze(t),F=null!==t[5]&&Qe(t);return{c(){e=h(\"div\"),n=h(\"div\"),i.c(),a=w(),l=h(\"div\"),s=h(\"div\"),c=h(\"span\"),C&&C.c(),d=w();for(let t=0;t<D.length;t+=1)D[t].c();b=w(),O&&O.c(),y=w(),I&&I.c(),x=w(),z&&z.c(),_=w(),F&&F.c(),k(e,\"class\",\"px-1 pt-1 pb-3 absolute opacity-95 bg-white shadow border border-gray-300 pointer-events-none z-50\"),E(e,\"top\",t[12]+\"px\"),E(e,\"left\",t[11]+\"px\"),E(e,\"display\",\"none\"),k(c,\"class\",\"flex flex-wrap text-sm\"),k(c,\"role\",\"main\"),k(s,\"class\",\"px-4\"),k(l,\"class\",\"pt-6 pb-6 flex text-gray-800 font-token\")},m(r,i){f(r,e,i),p(e,n),A[o].m(n,null),t[30](e),f(r,a,i),f(r,l,i),p(l,s),p(s,c),C&&C.m(c,null),p(c,d);for(let t=0;t<D.length;t+=1)D[t]&&D[t].m(c,null);p(c,b),O&&O.m(c,null),p(s,y),I&&I.m(s,null),p(s,x),z&&z.m(s,null),p(s,_),F&&F.m(s,null),$=!0,N||(T=[u(Ct.call(null,c,en)),v(c,\"longmouseover\",t[15]),v(c,\"longmouseout\",t[17]),v(c,\"mouseover\",t[16]),v(c,\"mouseout\",t[18]),v(c,\"focus\",t[19]),v(c,\"blur\",t[19])],N=!0)},p(t,r){let a=o;if(o=S(t),o===a?A[o].p(t,r):(Y(),J(A[a],1,1,(()=>{A[a]=null})),V(),i=A[o],i?i.p(t,r):(i=A[o]=M[o](t),i.c()),X(i,1),i.m(n,null)),(!$||4096&r[0])&&E(e,\"top\",t[12]+\"px\"),(!$||2048&r[0])&&E(e,\"left\",t[11]+\"px\"),t[1]?C?(C.p(t,r),2&r[0]&&X(C,1)):(C=Be(t),C.c(),X(C,1),C.m(c,d)):C&&(Y(),J(C,1,1,(()=>{C=null})),V()),896&r[0]){let e;for(R=K(t[7]),e=0;e<R.length;e+=1){const n=Oe(t,R,e);D[e]?(D[e].p(n,r),X(D[e],1)):(D[e]=Xe(n),D[e].c(),X(D[e],1),D[e].m(c,b))}for(Y(),e=R.length;e<D.length;e+=1)L(e);V()}!1===t[0]?O||(O=Je(),O.c(),O.m(c,null)):O&&(O.d(1),O=null),null!==t[4]?I?(I.p(t,r),16&r[0]&&X(I,1)):(I=Ke(t),I.c(),X(I,1),I.m(s,x)):I&&(Y(),J(I,1,1,(()=>{I=null})),V()),null!==t[6]?z?z.p(t,r):(z=Ze(t),z.c(),z.m(s,_)):z&&(z.d(1),z=null),null!==t[5]?F?F.p(t,r):(F=Qe(t),F.c(),F.m(s,null)):F&&(F.d(1),F=null)},i(t){if(!$){X(i),X(C);for(let t=0;t<R.length;t+=1)X(D[t]);X(I),$=!0}},o(t){J(i),J(C),D=D.filter(Boolean);for(let t=0;t<D.length;t+=1)J(D[t]);J(I),$=!1},d(n){n&&(m(e),m(a),m(l)),A[o].d(),t[30](null),C&&C.d(),g(D,n),O&&O.d(),I&&I.d(),z&&z.d(),F&&F.d(),N=!1,r(T)}}}const en=200;function nn(t,e,n){let{textComponents:r}=e,{tokenDetails:o}=e,{isCompleted:i}=e,{isError:a}=e,{requireFullReplay:l=!1}=e,{bgField:s=\"Token\"}=e,{underlineField:c=\"Probability\"}=e,u=t=>\"\",d=t=>\"\";const p=t=>{const e=(t=>{const e=t.match(/rgba?\\(\\s*(\\d+),\\s*(\\d+),\\s*(\\d+)/);return e?.299*parseInt(e[1],10)+.587*parseInt(e[2],10)+.114*parseInt(e[3],10):(console.error(\"Invalid RGBA format.\"),0)})(t);return e>186?\"rgba(0, 0, 0, 1)\":\"rgba(255, 255, 255, 1)\"},f=(t,e)=>{if(void 0===t)return\"\";let n=De(t);return`background-color: ${n}; color: ${p(n)};`},m=(t,e)=>{if(void 0===t)return\"\";return`border-bottom-color: ${Le(.7*t)};`},g=t=>{let e=\"\";return t.is_input?e=\"rgba(255, 255, 255, 0)\":t.is_force_forwarded?e=\"rgba(243, 244, 246, 1)\":t.is_generated?e=\"rgba(229, 231, 235, 1)\":(console.log(`ERROR: token ${t.text} does not have emit flags.`),e=\"rgba(255, 255, 255, 0)\"),`background-color: ${e};`},h=(t,e,n,r)=>{let o=!1,i=!1;return t<=n&&e-1>=n?o=!0:t<=r-1&&e>=r?(o=!0,i=!0):t>=n&&e<=r&&(o=!0),[o,i]};let b,y,w=null,x=null,v=null,k=[],_=[],$=[],E=new Set,N={},T=0,M={},A=0,S=0;let C=\"\",R=\"\";return t.$$set=t=>{\"textComponents\"in t&&n(22,r=t.textComponents),\"tokenDetails\"in t&&n(23,o=t.tokenDetails),\"isCompleted\"in t&&n(0,i=t.isCompleted),\"isError\"in t&&n(24,a=t.isError),\"requireFullReplay\"in t&&n(1,l=t.requireFullReplay),\"bgField\"in t&&n(2,s=t.bgField),\"underlineField\"in t&&n(3,c=t.underlineField)},t.$$.update=()=>{if(1069547773&t.$$.dirty[0]){for(0===r.length&&(n(7,k=[]),n(25,_=[]),n(26,$=[]),E.clear(),n(27,N={}),n(28,T=0));T<r.length;n(28,T+=1)){const t=r[T];if(lt(t))_.push(t),$.push(t.closer_text||\"\");else if(st(t))if(0===_.length)if(0!==$.length&&$[$.length-1]===t.value){const e={text:t.value,prob:t.prob,latency_ms:0,role:\"\",special:!0,is_input:t.is_input,is_force_forwarded:t.is_force_forwarded,is_generated:t.is_generated};E.add(e.text),k.push(e),$.pop()}else{const e={text:t.value,prob:t.prob,latency_ms:0,role:\"\",special:!1,is_input:t.is_input,is_force_forwarded:t.is_force_forwarded,is_generated:t.is_generated};k.push(e)}else{const e=_[_.length-1];e.text&&e.text!==t.value&&console.log(`Active role text does not match next text output: ${e.text} - ${t.value}`);const r={text:t.value,prob:t.prob,latency_ms:0,role:e.name||\"\",special:!0,is_input:t.is_input,is_force_forwarded:t.is_force_forwarded,is_generated:t.is_generated};\"\"!==r.role&&n(27,N[t.value]=r.role,N),E.add(r.text),k.push(r),_.pop()}else ut(t)?null===w&&n(4,w=t):ct(t)?null===x&&n(5,x=t):dt(t)&&null===v&&n(6,v=t)}0!==_.length||$.length;if(o.length>0){const t=function(t,e){const n=[];for(const r of e){let e=0;for(;-1!==(e=t.indexOf(r,e));)n.push([e,e+r.length,r]),e+=r.length}return n.sort(((t,e)=>t[0]===e[0]?t[1]-e[1]:t[0]-e[0])),n}(o.map((t=>t.text)).join(\"\"),Array.from(E));n(7,k=[]);let e=0,r=0,i=!1;for(const a of o){e=r,r=e+a.text.length;let o=!1,l=\"\";if(t.length>0){let[n,a,s]=t[0];e>=a&&(t.shift(),t.length>0&&([n,a,s]=t[0]));let[c,u]=h(e,r,n,a);if(c){if(Object.keys(N).includes(s)&&(i||(l=N[s],i=!0)),t.length>1){let[n,o,a]=t[1];const[s,c]=h(e,r,n,o);s&&Object.keys(N).includes(a)&&(l=N[a],i=!0,u=!1)}u||(o=!0)}else i=!1}const s={text:a.text,prob:a.prob,latency_ms:a.latency_ms,role:l,special:o,is_input:a.is_input,is_force_forwarded:a.is_force_forwarded,is_generated:a.is_generated,top_k:a.top_k};n(29,M[\"latency.max\"]=Math.max(s.latency_ms,M[\"latency.max\"]||0),M),k.push(s)}}n(8,u=!i||a?t=>\"border: none;\":\"Probability\"===c?t=>m(t.prob):\"Latency (ms)\"===c?t=>m(Math.log(t.latency_ms)/Math.log(M[\"latency.max\"])):t=>\"border: none;\"),!i||a||\"Type\"===s?n(9,d=t=>g(t)):\"Probability\"===s?n(9,d=t=>f(t.prob)):\"Latency (ms)\"===s?(n(9,d=t=>f(Math.log(t.latency_ms)/Math.log(M[\"latency.max\"]))),console.log(M[\"latency.max\"])):n(9,d=t=>\"\"),n(0,i),n(22,r),n(39,E),n(28,T),n(25,_),n(26,$),n(7,k),n(4,w),n(5,x),n(6,v),n(23,o),n(27,N),n(29,M),n(24,a),n(3,c),n(2,s),n(24,a),n(22,r),n(39,E),n(28,T),n(25,_),n(26,$),n(7,k),n(4,w),n(5,x),n(6,v),n(23,o),n(27,N),n(29,M),n(0,i),n(3,c),n(2,s),n(23,o),n(22,r),n(39,E),n(28,T),n(25,_),n(26,$),n(7,k),n(4,w),n(5,x),n(6,v),n(27,N),n(29,M),n(0,i),n(24,a),n(3,c),n(2,s),n(22,r),n(39,E),n(28,T),n(25,_),n(26,$),n(7,k),n(4,w),n(5,x),n(6,v),n(23,o),n(27,N),n(29,M),n(0,i),n(24,a),n(3,c),n(2,s),n(7,k),n(22,r),n(39,E),n(28,T),n(25,_),n(26,$),n(4,w),n(5,x),n(6,v),n(23,o),n(27,N),n(29,M),n(0,i),n(24,a),n(3,c),n(2,s)}},[i,l,s,c,w,x,v,k,u,d,b,A,S,y,(t,e)=>{if(\"Probability\"===e)return t.prob.toFixed(3);if(\"Latency (ms)\"===e)return t.latency_ms.toFixed(0);if(\"Type\"===e){if(t.is_input)return\"Input\";if(t.is_force_forwarded)return\"Forwarded\";if(t.is_generated)return\"Generated\"}else if(\"None\"===e)return\"\"},t=>{const e=t.detail.target;if(e.matches(\".token-grid-item\")){const t=e.dataset.index,r=15,o=10,i=e.getBoundingClientRect();n(11,A=i.left+window.scrollX+i.width/2+r),n(12,S=i.bottom+window.scrollY+o),n(10,b.style.display=\"block\",b);const a=Number(t);n(13,y=k[a]),A+b.offsetWidth>window.innerWidth&&n(11,A=window.innerWidth-b.offsetWidth),S+b.offsetHeight>window.innerHeight&&n(12,S=window.innerHeight-b.offsetHeight)}},t=>{var e;const n=t.target;if(n.matches(\".token-grid-item\")){const t=n.dataset.index,r=null===(e=n.parentElement)||void 0===e?void 0:e.querySelectorAll(`.token-grid-item[data-index=\"${t}\"]`);if(r)for(const t of r){const e=t;C=e.style.color,R=e.style.backgroundColor,e.style.color=\"rgb(249, 250, 251)\",e.style.backgroundColor=\"rgb(75, 85, 99)\"}}},t=>{t.detail.target.matches(\".token-grid-item\")&&n(10,b.style.display=\"none\",b)},t=>{var e;const n=t.target;if(n.matches(\".token-grid-item\")){const t=n.dataset.index,r=null===(e=n.parentElement)||void 0===e?void 0:e.querySelectorAll(`.token-grid-item[data-index=\"${t}\"]`);if(r)for(const t of r){const e=t;e.style.color=C,e.style.backgroundColor=R}}},t=>{},t=>Lt.sanitize(t.replaceAll(\" \",\"&nbsp;\").replaceAll(\"\\t\",\"\\\\t\").replaceAll(\"\\n\",\"\\\\n\")),{text:\"...\",prob:1,latency_ms:0,role:\"\",special:!1,is_input:!0,is_force_forwarded:!1,is_generated:!0},r,o,a,_,$,N,T,M,function(t){O[t?\"unshift\":\"push\"]((()=>{b=t,n(10,b)}))}]}class rn extends rt{constructor(t){super(),nt(this,t,nn,tn,i,{textComponents:22,tokenDetails:23,isCompleted:0,isError:24,requireFullReplay:1,bgField:2,underlineField:3},null,[-1,-1])}}function on(t){let e,n=null;return C((()=>{e=document.querySelector(\"html\"),window.addEventListener(\"load\",(()=>{n=setInterval((()=>{const t=e.getBoundingClientRect().height;if(0!==t&&e.checkVisibility()){const e={type:\"resize\",content:{height:`${t}px`,width:\"100%\"}};mt.set(e)}}),20)}))})),R((()=>{clearInterval(n)})),[]}class an extends rt{constructor(t){super(),nt(this,t,on,null,i,{})}}const{window:ln}=d;function sn(e){let n,r;return{c:t,m(t,o){n||(r=v(ln,\"message\",e[0]),n=!0)},p:t,i:t,o:t,d(t){n=!1,r()}}}function cn(t){let e=null,n=null;return C((()=>{e=mt.subscribe((t=>{void 0!==t&&window.parent.postMessage(t,\"*\")})),n=gt.subscribe((t=>{void 0!==t&&window.parent.postMessage(t,\"*\")}))})),R((()=>{e&&e(),n&&n()})),[t=>{if(t.source===window.parent&&\"type\"in t.data)if(\"kernelmsg\"===t.data.type){let e=t.data;ft.set(e)}else if(\"init_state\"===t.data.type){let e=t.data;gt.set(e)}}]}class un extends rt{constructor(t){super(),nt(this,t,cn,sn,i,{})}}function dn(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function pn(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function fn(t){let e,n,r;function o(t,r,o=0,i=t.length){if(o<i){if(0!==e(r,r))return i;do{const e=o+i>>>1;n(t[e],r)<0?o=e+1:i=e}while(o<i)}return o}return 2!==t.length?(e=dn,n=(e,n)=>dn(t(e),n),r=(e,n)=>t(e)-n):(e=t===dn||t===pn?t:mn,n=t,r=t),{left:o,center:function(t,e,n=0,i=t.length){const a=o(t,e,n,i-1);return a>n&&r(t[a-1],e)>-r(t[a],e)?a-1:a},right:function(t,r,o=0,i=t.length){if(o<i){if(0!==e(r,r))return i;do{const e=o+i>>>1;n(t[e],r)<=0?o=e+1:i=e}while(o<i)}return o}}}function mn(){return 0}const gn=fn(dn).right;fn((function(t){return null===t?NaN:+t})).center;const hn=Math.sqrt(50),bn=Math.sqrt(10),yn=Math.sqrt(2);function wn(t,e,n){const r=(e-t)/Math.max(0,n),o=Math.floor(Math.log10(r)),i=r/Math.pow(10,o),a=i>=hn?10:i>=bn?5:i>=yn?2:1;let l,s,c;return o<0?(c=Math.pow(10,-o)/a,l=Math.round(t*c),s=Math.round(e*c),l/c<t&&++l,s/c>e&&--s,c=-c):(c=Math.pow(10,o)*a,l=Math.round(t/c),s=Math.round(e/c),l*c<t&&++l,s*c>e&&--s),s<l&&.5<=n&&n<2?wn(t,e,2*n):[l,s,c]}function xn(t,e,n){return wn(t=+t,e=+e,n=+n)[2]}function vn(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function kn(t){return+t}var _n=[0,1];function $n(t){return t}function En(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:(n=isNaN(e)?NaN:.5,function(){return n});var n}function Nn(t,e,n){var r=t[0],o=t[1],i=e[0],a=e[1];return o<r?(r=En(o,r),i=n(a,i)):(r=En(r,o),i=n(i,a)),function(t){return i(r(t))}}function Tn(t,e,n){var r=Math.min(t.length,e.length)-1,o=new Array(r),i=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)o[a]=En(t[a],t[a+1]),i[a]=n(e[a],e[a+1]);return function(e){var n=gn(t,e,1,r)-1;return i[n](o[n](e))}}function Mn(){var t,e,n,r,o,i,a=_n,l=_n,s=Se,c=$n;function u(){var t,e,n,s=Math.min(a.length,l.length);return c!==$n&&(t=a[0],e=a[s-1],t>e&&(n=t,t=e,e=n),c=function(n){return Math.max(t,Math.min(e,n))}),r=s>2?Tn:Nn,o=i=null,d}function d(e){return null==e||isNaN(e=+e)?n:(o||(o=r(a.map(t),l,s)))(t(c(e)))}return d.invert=function(n){return c(e((i||(i=r(l,a.map(t),Ee)))(n)))},d.domain=function(t){return arguments.length?(a=Array.from(t,kn),u()):a.slice()},d.range=function(t){return arguments.length?(l=Array.from(t),u()):l.slice()},d.rangeRound=function(t){return l=Array.from(t),s=Ce,u()},d.clamp=function(t){return arguments.length?(c=!!t||$n,u()):c!==$n},d.interpolate=function(t){return arguments.length?(s=t,u()):s},d.unknown=function(t){return arguments.length?(n=t,d):n},function(n,r){return t=n,e=r,u()}}function An(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf(\"e\"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function Sn(t){return(t=An(Math.abs(t)))?t[1]:NaN}var Cn,Rn=/^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;function Dn(t){if(!(e=Rn.exec(t)))throw new Error(\"invalid format: \"+t);var e;return new Ln({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function Ln(t){this.fill=void 0===t.fill?\" \":t.fill+\"\",this.align=void 0===t.align?\">\":t.align+\"\",this.sign=void 0===t.sign?\"-\":t.sign+\"\",this.symbol=void 0===t.symbol?\"\":t.symbol+\"\",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?\"\":t.type+\"\"}function On(t,e){var n=An(t,e);if(!n)return t+\"\";var r=n[0],o=n[1];return o<0?\"0.\"+new Array(-o).join(\"0\")+r:r.length>o+1?r.slice(0,o+1)+\".\"+r.slice(o+1):r+new Array(o-r.length+2).join(\"0\")}Dn.prototype=Ln.prototype,Ln.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?\"0\":\"\")+(void 0===this.width?\"\":Math.max(1,0|this.width))+(this.comma?\",\":\"\")+(void 0===this.precision?\"\":\".\"+Math.max(0,0|this.precision))+(this.trim?\"~\":\"\")+this.type};var In={\"%\":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+\"\",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString(\"en\").replace(/,/g,\"\"):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>On(100*t,e),r:On,s:function(t,e){var n=An(t,e);if(!n)return t+\"\";var r=n[0],o=n[1],i=o-(Cn=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,a=r.length;return i===a?r:i>a?r+new Array(i-a+1).join(\"0\"):i>0?r.slice(0,i)+\".\"+r.slice(i):\"0.\"+new Array(1-i).join(\"0\")+An(t,Math.max(0,e+i-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function zn(t){return t}var Fn,Pn,Un,Hn=Array.prototype.map,jn=[\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"µ\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"];function qn(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?zn:(e=Hn.call(t.grouping,Number),n=t.thousands+\"\",function(t,r){for(var o=t.length,i=[],a=0,l=e[0],s=0;o>0&&l>0&&(s+l+1>r&&(l=Math.max(1,r-s)),i.push(t.substring(o-=l,o+l)),!((s+=l+1)>r));)l=e[a=(a+1)%e.length];return i.reverse().join(n)}),o=void 0===t.currency?\"\":t.currency[0]+\"\",i=void 0===t.currency?\"\":t.currency[1]+\"\",a=void 0===t.decimal?\".\":t.decimal+\"\",l=void 0===t.numerals?zn:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Hn.call(t.numerals,String)),s=void 0===t.percent?\"%\":t.percent+\"\",c=void 0===t.minus?\"−\":t.minus+\"\",u=void 0===t.nan?\"NaN\":t.nan+\"\";function d(t){var e=(t=Dn(t)).fill,n=t.align,d=t.sign,p=t.symbol,f=t.zero,m=t.width,g=t.comma,h=t.precision,b=t.trim,y=t.type;\"n\"===y?(g=!0,y=\"g\"):In[y]||(void 0===h&&(h=12),b=!0,y=\"g\"),(f||\"0\"===e&&\"=\"===n)&&(f=!0,e=\"0\",n=\"=\");var w=\"$\"===p?o:\"#\"===p&&/[boxX]/.test(y)?\"0\"+y.toLowerCase():\"\",x=\"$\"===p?i:/[%p]/.test(y)?s:\"\",v=In[y],k=/[defgprs%]/.test(y);function _(t){var o,i,s,p=w,_=x;if(\"c\"===y)_=v(t)+_,t=\"\";else{var $=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:v(Math.abs(t),h),b&&(t=function(t){t:for(var e,n=t.length,r=1,o=-1;r<n;++r)switch(t[r]){case\".\":o=e=r;break;case\"0\":0===o&&(o=r),e=r;break;default:if(!+t[r])break t;o>0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t}(t)),$&&0==+t&&\"+\"!==d&&($=!1),p=($?\"(\"===d?d:c:\"-\"===d||\"(\"===d?\"\":d)+p,_=(\"s\"===y?jn[8+Cn/3]:\"\")+_+($&&\"(\"===d?\")\":\"\"),k)for(o=-1,i=t.length;++o<i;)if(48>(s=t.charCodeAt(o))||s>57){_=(46===s?a+t.slice(o+1):t.slice(o))+_,t=t.slice(0,o);break}}g&&!f&&(t=r(t,1/0));var E=p.length+t.length+_.length,N=E<m?new Array(m-E+1).join(e):\"\";switch(g&&f&&(t=r(N+t,N.length?m-_.length:1/0),N=\"\"),n){case\"<\":t=p+t+_+N;break;case\"=\":t=p+N+t+_;break;case\"^\":t=N.slice(0,E=N.length>>1)+p+t+_+N.slice(E);break;default:t=N+p+t+_}return l(t)}return h=void 0===h?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,h)):Math.max(0,Math.min(20,h)),_.toString=function(){return t+\"\"},_}return{format:d,formatPrefix:function(t,e){var n=d(((t=Dn(t)).type=\"f\",t)),r=3*Math.max(-8,Math.min(8,Math.floor(Sn(e)/3))),o=Math.pow(10,-r),i=jn[8+r/3];return function(t){return n(o*t)+i}}}}function Bn(t,e,n,r){var o,i=function(t,e,n){n=+n;const r=(e=+e)<(t=+t),o=r?xn(e,t,n):xn(t,e,n);return(r?-1:1)*(o<0?1/-o:o)}(t,e,n);switch((r=Dn(null==r?\",f\":r)).type){case\"s\":var a=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(o=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Sn(e)/3)))-Sn(Math.abs(t)))}(i,a))||(r.precision=o),Un(r,a);case\"\":case\"e\":case\"g\":case\"p\":case\"r\":null!=r.precision||isNaN(o=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Sn(e)-Sn(t))+1}(i,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=o-(\"e\"===r.type));break;case\"f\":case\"%\":null!=r.precision||isNaN(o=function(t){return Math.max(0,-Sn(Math.abs(t)))}(i))||(r.precision=o-2*(\"%\"===r.type))}return Pn(r)}function Wn(t){var e=t.domain;return t.ticks=function(t){var n=e();return function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)==(e=+e))return[t];const r=e<t,[o,i,a]=r?wn(e,t,n):wn(t,e,n);if(!(i>=o))return[];const l=i-o+1,s=new Array(l);if(r)if(a<0)for(let t=0;t<l;++t)s[t]=(i-t)/-a;else for(let t=0;t<l;++t)s[t]=(i-t)*a;else if(a<0)for(let t=0;t<l;++t)s[t]=(o+t)/-a;else for(let t=0;t<l;++t)s[t]=(o+t)*a;return s}(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return Bn(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,o,i=e(),a=0,l=i.length-1,s=i[a],c=i[l],u=10;for(c<s&&(o=s,s=c,c=o,o=a,a=l,l=o);u-- >0;){if((o=xn(s,c,n))===r)return i[a]=s,i[l]=c,e(i);if(o>0)s=Math.floor(s/o)*o,c=Math.ceil(c/o)*o;else{if(!(o<0))break;s=Math.ceil(s*o)/o,c=Math.floor(c*o)/o}r=o}return t},t}function Gn(){var t=Mn()($n,$n);return t.copy=function(){return e=t,Gn().domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown());var e},vn.apply(t,arguments),Wn(t)}function Yn(e){let n,r,o,i,a,l;return{c(){n=h(\"div\"),r=b(\"svg\"),o=b(\"g\"),i=b(\"path\"),k(i,\"d\",a=e[3].map(Vn).join(\" \")),k(i,\"fill\",\"none\"),k(i,\"stroke-width\",\"1.25\"),k(i,\"stroke\",\"#374151\"),k(r,\"class\",e[0]),k(n,\"class\",\"inline-block font-medium text-gray-700\"),U((()=>e[9].call(n)))},m(t,a){f(t,n,a),p(n,r),p(r,o),p(o,i),l=function(t,e){\"static\"===getComputedStyle(t).position&&(t.style.position=\"relative\");const n=h(\"iframe\");n.setAttribute(\"style\",\"display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;\"),n.setAttribute(\"aria-hidden\",\"true\"),n.tabIndex=-1;const r=M();let o;return r?(n.src=\"data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\\/script>\",o=v(window,\"message\",(t=>{t.source===n.contentWindow&&e()}))):(n.src=\"about:blank\",n.onload=()=>{o=v(n.contentWindow,\"resize\",e),e()}),p(t,n),()=>{(r||o&&n.contentWindow)&&o(),m(n)}}(n,e[9].bind(n))},p(t,[e]){8&e&&a!==(a=t[3].map(Vn).join(\" \"))&&k(i,\"d\",a),1&e&&k(r,\"class\",t[0])},i:t,o:t,d(t){t&&m(n),l()}}}Fn=qn({thousands:\",\",grouping:[3],currency:[\"$\",\"\"]}),Pn=Fn.format,Un=Fn.formatPrefix;const Vn=(t,e)=>`${0===e?\"M\":\"L\"} ${t.x} ${t.y}`;function Xn(t,e,n){let r,o,i,a,{values:l}=e,{svgClass:s}=e,{padding:c={left:0,right:0,top:0,bottom:0}}=e,u=0,d=0;return t.$$set=t=>{\"values\"in t&&n(4,l=t.values),\"svgClass\"in t&&n(0,s=t.svgClass),\"padding\"in t&&n(5,c=t.padding)},t.$$.update=()=>{16&t.$$.dirty&&n(8,r=l),292&t.$$.dirty&&n(7,o=Gn().domain([0,r.length-1]).range([c.left,c.left+d-c.right])),34&t.$$.dirty&&n(6,i=Gn().domain([0,1]).range([u-c.bottom,c.top])),448&t.$$.dirty&&n(3,a=r.map(((t,e)=>({x:o(e),y:i(t)}))))},[s,u,d,a,l,c,i,o,r,function(){u=this.clientHeight,d=this.clientWidth,n(1,u),n(2,d)}]}class Jn extends rt{constructor(t){super(),nt(this,t,Xn,Yn,i,{values:4,svgClass:0,padding:5})}}function Kn(e){let n,r,o,i,a=e[0].name+\"\";function l(t,e){return\"number\"==typeof t[1]?tr:Qn}let s=l(e),u=s(e);return{c(){n=h(\"span\"),r=y(a),o=w(),u.c(),i=x(),k(n,\"class\",c(\"text-gray-600 whitespace-nowrap pr-[0.125rem]\")+\" svelte-198q8s6\")},m(t,e){f(t,n,e),p(n,r),f(t,o,e),u.m(t,e),f(t,i,e)},p(t,e){1&e&&a!==(a=t[0].name+\"\")&&_(r,a),s===(s=l(t))&&u?u.p(t,e):(u.d(1),u=s(t),u&&(u.c(),u.m(i.parentNode,i)))},i:t,o:t,d(t){t&&(m(n),m(o),m(i)),u.d(t)}}}function Zn(t){let e,n,r,o,i,a=t[0].name+\"\";return o=new Jn({props:{values:t[1],svgClass:\"w-8 h-4 inline\",padding:t[2]}}),{c(){e=h(\"span\"),n=y(a),r=w(),Z(o.$$.fragment),k(e,\"class\",c(\"text-gray-600 whitespace-nowrap pr-[0.125rem]\")+\" svelte-198q8s6\")},m(t,a){f(t,e,a),p(e,n),f(t,r,a),Q(o,t,a),i=!0},p(t,e){(!i||1&e)&&a!==(a=t[0].name+\"\")&&_(n,a);const r={};2&e&&(r.values=t[1]),o.$set(r)},i(t){i||(X(o.$$.fragment,t),i=!0)},o(t){J(o.$$.fragment,t),i=!1},d(t){t&&(m(e),m(r)),tt(o,t)}}}function Qn(t){let e,n,r,o=\"\"!==t[0].units&&er(t);return{c(){e=h(\"span\"),n=y(t[1]),r=w(),o&&o.c(),k(e,\"class\",c(\"font-medium text-center text-gray-700 \")+\" svelte-198q8s6\")},m(t,i){f(t,e,i),p(e,n),p(e,r),o&&o.m(e,null)},p(t,r){2&r&&_(n,t[1]),\"\"!==t[0].units?o?o.p(t,r):(o=er(t),o.c(),o.m(e,null)):o&&(o.d(1),o=null)},d(t){t&&m(e),o&&o.d()}}}function tr(t){let e,n,r,o=t[1].toFixed(t[0].precision)+\"\",i=\"\"!==t[0].units&&nr(t);return{c(){e=h(\"span\"),n=y(o),r=w(),i&&i.c(),k(e,\"class\",c(\"font-medium text-gray-700 \")+\" svelte-198q8s6\")},m(t,o){f(t,e,o),p(e,n),p(e,r),i&&i.m(e,null)},p(t,r){3&r&&o!==(o=t[1].toFixed(t[0].precision)+\"\")&&_(n,o),\"\"!==t[0].units?i?i.p(t,r):(i=nr(t),i.c(),i.m(e,null)):i&&(i.d(1),i=null)},d(t){t&&m(e),i&&i.d()}}}function er(t){let e,n,r=t[0].units+\"\";return{c(){e=h(\"span\"),n=y(r),k(e,\"class\",\"\")},m(t,r){f(t,e,r),p(e,n)},p(t,e){1&e&&r!==(r=t[0].units+\"\")&&_(n,r)},d(t){t&&m(e)}}}function nr(t){let e,n,r=t[0].units+\"\";return{c(){e=h(\"span\"),n=y(r),k(e,\"class\",\"\")},m(t,r){f(t,e,r),p(e,n)},p(t,e){1&e&&r!==(r=t[0].units+\"\")&&_(n,r)},d(t){t&&m(e)}}}function rr(t){let e,n,r,o,i,a;const l=[Zn,Kn],s=[];function u(t,e){return t[1].constructor===Array?0:1}return r=u(t),o=s[r]=l[r](t),{c(){e=h(\"span\"),n=h(\"span\"),o.c(),k(e,\"class\",c(\"dot-divider flex items-center text-xs whitespace-nowrap px-1\")+\" svelte-198q8s6\"),k(e,\"title\",i=t[0].description)},m(t,o){f(t,e,o),p(e,n),s[r].m(n,null),a=!0},p(t,[c]){let d=r;r=u(t),r===d?s[r].p(t,c):(Y(),J(s[d],1,1,(()=>{s[d]=null})),V(),o=s[r],o?o.p(t,c):(o=s[r]=l[r](t),o.c()),X(o,1),o.m(n,null)),(!a||1&c&&i!==(i=t[0].description))&&k(e,\"title\",i)},i(t){a||(X(o),a=!0)},o(t){J(o),a=!1},d(t){t&&m(e),s[r].d()}}}function or(t,e,n){let{metricDef:r}=e,{value:o}=e;return t.$$set=t=>{\"metricDef\"in t&&n(0,r=t.metricDef),\"value\"in t&&n(1,o=t.value)},[r,o,{left:0,right:0,top:5,bottom:3}]}ot('.dot-divider.svelte-198q8s6:not(:last-child):after{color:#d1d5db;content:\"•\";margin-left:.5rem}');class ir extends rt{constructor(t){super(),nt(this,t,or,rr,i,{metricDef:0,value:1})}}function ar(t){var e=function(e){var n=e.target;t.contains(n)||t.dispatchEvent(new CustomEvent(\"outclick\"))};return document.addEventListener(\"click\",e,!0),{destroy:function(){document.removeEventListener(\"click\",e,!0)}}}function lr(t,e,n){const r=t.slice();return r[10]=e[n],r[12]=n,r}function sr(t){let e,n=K(t[1]),r=[];for(let e=0;e<n.length;e+=1)r[e]=cr(lr(t,n,e));return{c(){e=h(\"ul\");for(let t=0;t<r.length;t+=1)r[t].c();k(e,\"role\",\"listbox\"),k(e,\"class\",\"absolute pt-2 pb-3 z-10 mt-1 bg-white shadow border border-gray-300\")},m(t,n){f(t,e,n);for(let t=0;t<r.length;t+=1)r[t]&&r[t].m(e,null)},p(t,o){if(66&o){let i;for(n=K(t[1]),i=0;i<n.length;i+=1){const a=lr(t,n,i);r[i]?r[i].p(a,o):(r[i]=cr(a),r[i].c(),r[i].m(e,null))}for(;i<r.length;i+=1)r[i].d(1);r.length=n.length}},d(t){t&&m(e),g(r,t)}}}function cr(t){let e,n,o,i,a=t[10]+\"\";function l(...e){return t[8](t[10],...e)}return{c(){e=h(\"li\"),n=y(a),k(e,\"class\",`w-full px-4 py-1 ${0===t[12]?\"mt-1\":\"\"} hover:bg-gray-700 hover:text-white text-nowrap`),k(e,\"role\",\"option\"),k(e,\"aria-selected\",\"false\")},m(t,r){f(t,e,r),p(e,n),o||(i=[v(e,\"click\",l),v(e,\"keypress\",dr)],o=!0)},p(e,r){t=e,2&r&&a!==(a=t[10]+\"\")&&_(n,a)},d(t){t&&m(e),o=!1,r(i)}}}function ur(e){let n,o,i,a,l,s,c,d,g,x,$,E,N=e[3]&&sr(e);return{c(){n=h(\"div\"),o=h(\"button\"),i=h(\"span\"),a=h(\"span\"),l=y(e[2]),s=w(),c=b(\"svg\"),d=b(\"path\"),x=w(),N&&N.c(),k(a,\"class\",\"\"),k(d,\"fill-rule\",\"evenodd\"),k(d,\"d\",\"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z\"),k(d,\"clip-rule\",\"evenodd\"),k(c,\"xmlns\",\"http://www.w3.org/2000/svg\"),k(c,\"viewBox\",\"0 0 16 16\"),k(c,\"fill\",\"currentColor\"),k(c,\"class\",\"size-4\"),k(i,\"class\",g=`mr-4 inline-flex justify-between items-center hover:bg-gray-700 hover:text-white ${e[0]}`),k(n,\"class\",\"relative\")},m(t,r){f(t,n,r),p(n,o),p(o,i),p(i,a),p(a,l),p(i,s),p(i,c),p(c,d),p(n,x),N&&N.m(n,null),$||(E=[u(ar.call(null,o)),v(o,\"click\",e[4]),u(ar.call(null,n)),v(n,\"outclick\",e[5])],$=!0)},p(t,[e]){4&e&&_(l,t[2]),1&e&&g!==(g=`mr-4 inline-flex justify-between items-center hover:bg-gray-700 hover:text-white ${t[0]}`)&&k(i,\"class\",g),t[3]?N?N.p(t,e):(N=sr(t),N.c(),N.m(n,null)):N&&(N.d(1),N=null)},i:t,o:t,d(t){t&&m(n),N&&N.d(),$=!1,r(E)}}}const dr=t=>{};function pr(t,e,n){let{classes:r=\"\"}=e,{values:o=[]}=e,{defaultValue:i=\"\"}=e,a=i,l=!1;const s=D(),c=t=>{n(2,a=t),n(3,l=!1),s(\"select\",a)};return t.$$set=t=>{\"classes\"in t&&n(0,r=t.classes),\"values\"in t&&n(1,o=t.values),\"defaultValue\"in t&&n(7,i=t.defaultValue)},[r,o,a,l,t=>{n(3,l=!l)},t=>{n(3,l=!1)},c,i,(t,e)=>c(t)]}class fr extends rt{constructor(t){super(),nt(this,t,pr,ur,i,{classes:0,values:1,defaultValue:7})}}var mr={status:{name:\"\",units:\"\",description:\"Determines whether engine is running, completed or in error.\",isScalar:!0,precision:0},cpu:{name:\"CPU\",units:\"%\",description:\"Average utilization across CPU cores.\",isScalar:!1,precision:1},gpu:{name:\"GPU\",units:\"%\",description:\"Average utilization across GPUs.\",isScalar:!1,precision:1},ram:{name:\"RAM\",units:\"GB\",description:\"Utilization of RAM.\",isScalar:!0,precision:1},vram:{name:\"VRAM\",units:\"GB\",description:\"Utilization of video RAM.\",isScalar:!0,precision:1},\"wall time\":{name:\"Time\",units:\"s\",description:\"Time taken from initial display to engine completion.\",isScalar:!0,precision:1},\"avg latency\":{name:\"Latency\",units:\"ms\",description:\"Average roundtrip latency per token\",isScalar:!0,precision:0},consumed:{name:\"Used\",units:\"tkn\",description:\"Total tokens consumed by language model.\",isScalar:!0,precision:0},\"token reduction\":{name:\"Reduced\",units:\"%\",description:\"Total tokens consumed by language model divided by total tokens.\",isScalar:!0,precision:0}};function gr(t,e,n){const r=t.slice();return r[8]=e[n],r}function hr(t){let e,n;return e=new ir({props:{value:t[0].metrics[t[8]],metricDef:mr[t[8]]}}),{c(){Z(e.$$.fragment)},m(t,r){Q(e,t,r),n=!0},p(t,n){const r={};1&n&&(r.value=t[0].metrics[t[8]]),1&n&&(r.metricDef=mr[t[8]]),e.$set(r)},i(t){n||(X(e.$$.fragment,t),n=!0)},o(t){J(e.$$.fragment,t),n=!1},d(t){tt(e,t)}}}function br(t){let e,n,r,o,i,a,l,s,c,u,d,b,y,x,v,_,$,E,N,T;r=new un({}),i=new an({}),b=new fr({props:{values:[\"None\",\"Type\",\"Probability\",\"Latency (ms)\"],classes:\"ml-4 pl-1 bg-gray-200\",defaultValue:\"Type\"}}),b.$on(\"select\",t[5]),x=new fr({props:{values:[\"None\",\"Probability\",\"Latency (ms)\"],classes:\"border-b-2 pl-1 border-gray-400\",defaultValue:\"Probability\"}}),x.$on(\"select\",t[6]);let M=K(t[0].shownMetrics),A=[];for(let e=0;e<M.length;e+=1)A[e]=hr(gr(t,M,e));const S=t=>J(A[t],1,1,(()=>{A[t]=null}));return N=new rn({props:{textComponents:t[0].textComponents,tokenDetails:t[0].tokenDetails,isCompleted:[\"Done\",\"Error\"].includes(t[0].status),isError:t[0].status===pt.Error,bgField:t[1],underlineField:t[2],requireFullReplay:t[0].requireFullReplay}}),{c(){e=h(\"meta\"),n=w(),Z(r.$$.fragment),o=w(),Z(i.$$.fragment),a=w(),l=h(\"div\"),s=h(\"nav\"),c=h(\"section\"),u=h(\"div\"),d=h(\"span\"),Z(b.$$.fragment),y=w(),Z(x.$$.fragment),v=w(),_=h(\"span\");for(let t=0;t<A.length;t+=1)A[t].c();$=w(),E=h(\"section\"),Z(N.$$.fragment),document.title=\"graphpaper\",k(e,\"name\",\"description\"),k(e,\"content\",\"graphpaper\"),k(d,\"class\",\"flex mr-2\"),k(_,\"class\",\"flex mr-4 text-gray-300 overflow-x-scroll scrollbar-thin scrollbar-track-gray-100 scrollbar-thumb-gray-200\"),k(u,\"class\",\"text-sm pt-2 pb-2 flex justify-between border-b border-gray-200\"),k(c,\"class\",\"\"),k(s,\"class\",\"sticky top-0 z-50 opacity-90\"),k(E,\"class\",\"w-full\"),k(l,\"class\",\"w-full min-h-72\")},m(t,m){p(document.head,e),f(t,n,m),Q(r,t,m),f(t,o,m),Q(i,t,m),f(t,a,m),f(t,l,m),p(l,s),p(s,c),p(c,u),p(u,d),Q(b,d,null),p(d,y),Q(x,d,null),p(u,v),p(u,_);for(let t=0;t<A.length;t+=1)A[t]&&A[t].m(_,null);p(l,$),p(l,E),Q(N,E,null),T=!0},p(t,[e]){if(1&e){let n;for(M=K(t[0].shownMetrics),n=0;n<M.length;n+=1){const r=gr(t,M,n);A[n]?(A[n].p(r,e),X(A[n],1)):(A[n]=hr(r),A[n].c(),X(A[n],1),A[n].m(_,null))}for(Y(),n=M.length;n<A.length;n+=1)S(n);V()}const n={};1&e&&(n.textComponents=t[0].textComponents),1&e&&(n.tokenDetails=t[0].tokenDetails),1&e&&(n.isCompleted=[\"Done\",\"Error\"].includes(t[0].status)),1&e&&(n.isError=t[0].status===pt.Error),2&e&&(n.bgField=t[1]),4&e&&(n.underlineField=t[2]),1&e&&(n.requireFullReplay=t[0].requireFullReplay),N.$set(n)},i(t){if(!T){X(r.$$.fragment,t),X(i.$$.fragment,t),X(b.$$.fragment,t),X(x.$$.fragment,t);for(let t=0;t<M.length;t+=1)X(A[t]);X(N.$$.fragment,t),T=!0}},o(t){J(r.$$.fragment,t),J(i.$$.fragment,t),J(b.$$.fragment,t),J(x.$$.fragment,t),A=A.filter(Boolean);for(let t=0;t<A.length;t+=1)J(A[t]);J(N.$$.fragment,t),T=!1},d(t){t&&(m(n),m(o),m(a),m(l)),m(e),tt(r,t),tt(i,t),tt(b),tt(x),g(A,t),tt(N)}}}function yr(t,e,n){let r,o;s(t,ft,(t=>n(3,r=t))),s(t,gt,(t=>n(4,o=t)));let i={textComponents:[],tokenDetails:[],status:pt.Running,shownMetrics:[],metrics:{status:pt.Running,\"wall time\":0,consumed:0,\"token reduction\":0,\"avg latency\":0,cpu:[0,0,0,0,0],gpu:[0,0,0,0,0],ram:0,vram:0},requireFullReplay:!1},a=\"Type\",l=\"Probability\";C((()=>{const t={type:\"clientmsg\",content:JSON.stringify({class_name:\"ClientReadyMessage\"})};mt.set(t)}));return t.$$.update=()=>{if(16&t.$$.dirty&&void 0!==o&&\"\"!==o.content&&n(0,i=JSON.parse(o.content)),8&t.$$.dirty&&void 0!==r&&\"\"!==r.content){(t=>{if(null!=(e=t)&&\"TraceMessage\"===e.class_name)st(t.node_attr)||lt(t.node_attr)||function(t){return null!=t&&\"RoleCloserInput\"===t.class_name}(t.node_attr)?i.textComponents.push(t.node_attr):ut(t.node_attr)?(console.log(\"Audio available\"),i.textComponents.push(t.node_attr)):ct(t.node_attr)?(console.log(\"Image available\"),i.textComponents.push(t.node_attr)):dt(t.node_attr)&&(console.log(\"Video available\"),i.textComponents.push(t.node_attr));else if(function(t){return null!=t&&\"ExecutionStartedMessage\"===t.class_name}(t))n(0,i.requireFullReplay=!1,i);else if(function(t){return null!=t&&\"ClientReadyAckMessage\"===t.class_name}(t)){if(i.requireFullReplay){console.log(\"Require full replay and went past completion output message.\");const t={type:\"clientmsg\",content:JSON.stringify({class_name:\"OutputRequestMessage\"})};mt.set(t)}}else if(function(t){return null!=t&&\"ResetDisplayMessage\"===t.class_name}(t))n(0,i.textComponents=[],i),n(0,i.status=i.status!==pt.Error?pt.Running:i.status,i);else if(function(t){return null!=t&&\"MetricMessage\"===t.class_name}(t)){const e=t.name,r=t.value;if(e in i.metrics&&e in mr){let t=i.metrics[e];const o=mr[e];!1===o.isScalar?r.constructor===Array?n(0,i.metrics[e]=r,i):n(0,i.metrics[e]=[...t.slice(1),r],i):!0===o.isScalar?n(0,i.metrics[e]=r,i):console.error(`Cannot handle metric: ${e}: ${r}.`),\"status\"===e&&n(0,i.status=r,i)}}else if(function(t){return null!=t&&\"ExecutionCompletedMessage\"===t.class_name}(t))n(0,i.status=pt.Done,i);else if(function(t){return null!=t&&\"TokensMessage\"===t.class_name}(t)){n(0,i.requireFullReplay=!1,i),n(0,i.status=pt.Done,i),n(0,i.tokenDetails=t.tokens,i);const e={type:\"state\",content:JSON.stringify(i)};gt.set(e)}var e;n(0,i),n(4,o)})(JSON.parse(r.content))}1&t.$$.dirty&&(i.status===pt.Running?n(0,i.shownMetrics=[\"status\",\"wall time\",\"cpu\",\"ram\",\"gpu\",\"vram\"],i):n(0,i.shownMetrics=[\"status\",\"consumed\",\"token reduction\",\"avg latency\",\"wall time\"],i))},[i,a,l,r,o,t=>n(1,a=t.detail),t=>n(2,l=t.detail)]}return new class extends rt{constructor(t){super(),nt(this,t,yr,br,i,{})}}({target:document.body})}();\n</script>\n</body>\n</html>\n"
      }
     },
     "4266ce80971f4a5293946dd09d578b6a": {
      "model_module": "@guidance-ai/stitch",
      "model_module_version": "^0.1.4",
      "model_name": "StitchModel",
      "state": {
       "_model_module_version": "^0.1.4",
       "_view_module_version": "^0.1.4",
       "clientmsg": "{\"class_name\":\"ClientReadyMessage\"}",
       "initial_height": "auto",
       "initial_width": "100%",
       "kernelmsg": "{\n  \"message_id\": 169,\n  \"class_name\": \"ClientReadyAckMessage\"\n}",
       "layout": "IPY_MODEL_6117177dcc9148aca360cbd9d99a4448",
       "srcdoc": "<!doctype html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n\n    <link rel=\"preconnect\" href=\"https://fonts.googleapis.com\">\n    <link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin>\n    <link href=\"https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap\" rel=\"stylesheet\">\n</head>\n<body>\n<script>\nvar app=function(){\"use strict\";function t(){}function e(t){return t()}function n(){return Object.create(null)}function r(t){t.forEach(e)}function o(t){return\"function\"==typeof t}function i(t,e){return t!=t?e==e:t!==e||t&&\"object\"==typeof t||\"function\"==typeof t}let a;function l(t,e){return t===e||(a||(a=document.createElement(\"a\")),a.href=e,t===a.href)}function s(e,n,r){e.$$.on_destroy.push(function(e,...n){if(null==e){for(const t of n)t(void 0);return t}const r=e.subscribe(...n);return r.unsubscribe?()=>r.unsubscribe():r}(n,r))}function c(t){return null==t?\"\":t}function u(e){return e&&o(e.destroy)?e.destroy:t}const d=\"undefined\"!=typeof window?window:\"undefined\"!=typeof globalThis?globalThis:global;function p(t,e){t.appendChild(e)}function f(t,e,n){t.insertBefore(e,n||null)}function m(t){t.parentNode&&t.parentNode.removeChild(t)}function g(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function h(t){return document.createElement(t)}function b(t){return document.createElementNS(\"http://www.w3.org/2000/svg\",t)}function y(t){return document.createTextNode(t)}function w(){return y(\" \")}function x(){return y(\"\")}function v(t,e,n,r){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}function k(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function _(t,e){e=\"\"+e,t.data!==e&&(t.data=e)}function $(t,e){t.value=null==e?\"\":e}function E(t,e,n,r){null==n?t.style.removeProperty(e):t.style.setProperty(e,n,\"\")}let N,T;function M(){if(void 0===N){N=!1;try{\"undefined\"!=typeof window&&window.parent&&window.parent.document}catch(t){N=!0}}return N}function A(t){T=t}function S(){if(!T)throw new Error(\"Function called outside component initialization\");return T}function C(t){S().$$.on_mount.push(t)}function R(t){S().$$.on_destroy.push(t)}function D(){const t=S();return(e,n,{cancelable:r=!1}={})=>{const o=t.$$.callbacks[e];if(o){const i=function(t,e,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(t,{detail:e,bubbles:n,cancelable:r})}(e,n,{cancelable:r});return o.slice().forEach((e=>{e.call(t,i)})),!i.defaultPrevented}return!0}}const L=[],O=[];let I=[];const z=[],F=Promise.resolve();let P=!1;function U(t){I.push(t)}const H=new Set;let j=0;function q(){if(0!==j)return;const t=T;do{try{for(;j<L.length;){const t=L[j];j++,A(t),B(t.$$)}}catch(t){throw L.length=0,j=0,t}for(A(null),L.length=0,j=0;O.length;)O.pop()();for(let t=0;t<I.length;t+=1){const e=I[t];H.has(e)||(H.add(e),e())}I.length=0}while(L.length);for(;z.length;)z.pop()();P=!1,H.clear(),A(t)}function B(t){if(null!==t.fragment){t.update(),r(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(U)}}const W=new Set;let G;function Y(){G={r:0,c:[],p:G}}function V(){G.r||r(G.c),G=G.p}function X(t,e){t&&t.i&&(W.delete(t),t.i(e))}function J(t,e,n,r){if(t&&t.o){if(W.has(t))return;W.add(t),G.c.push((()=>{W.delete(t),r&&(n&&t.d(1),r())})),t.o(e)}else r&&r()}function K(t){return void 0!==t?.length?t:Array.from(t)}function Z(t){t&&t.c()}function Q(t,n,i){const{fragment:a,after_update:l}=t.$$;a&&a.m(n,i),U((()=>{const n=t.$$.on_mount.map(e).filter(o);t.$$.on_destroy?t.$$.on_destroy.push(...n):r(n),t.$$.on_mount=[]})),l.forEach(U)}function tt(t,e){const n=t.$$;null!==n.fragment&&(!function(t){const e=[],n=[];I.forEach((r=>-1===t.indexOf(r)?e.push(r):n.push(r))),n.forEach((t=>t())),I=e}(n.after_update),r(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function et(t,e){-1===t.$$.dirty[0]&&(L.push(t),P||(P=!0,F.then(q)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function nt(e,o,i,a,l,s,c=null,u=[-1]){const d=T;A(e);const p=e.$$={fragment:null,ctx:[],props:s,update:t,not_equal:l,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(o.context||(d?d.$$.context:[])),callbacks:n(),dirty:u,skip_bound:!1,root:o.target||d.$$.root};c&&c(p.root);let f=!1;if(p.ctx=i?i(e,o.props||{},((t,n,...r)=>{const o=r.length?r[0]:n;return p.ctx&&l(p.ctx[t],p.ctx[t]=o)&&(!p.skip_bound&&p.bound[t]&&p.bound[t](o),f&&et(e,t)),n})):[],p.update(),f=!0,r(p.before_update),p.fragment=!!a&&a(p.ctx),o.target){if(o.hydrate){const t=function(t){return Array.from(t.childNodes)}(o.target);p.fragment&&p.fragment.l(t),t.forEach(m)}else p.fragment&&p.fragment.c();o.intro&&X(e.$$.fragment),Q(e,o.target,o.anchor),q()}A(d)}class rt{$$=void 0;$$set=void 0;$destroy(){tt(this,1),this.$destroy=t}$on(e,n){if(!o(n))return t;const r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(n),()=>{const t=r.indexOf(n);-1!==t&&r.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function ot(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&\"undefined\"!=typeof document){var r=document.head||document.getElementsByTagName(\"head\")[0],o=document.createElement(\"style\");o.type=\"text/css\",\"top\"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}\"undefined\"!=typeof window&&(window.__svelte||(window.__svelte={v:new Set})).v.add(\"4\");ot('/*! tailwindcss v3.4.10 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:\"\"}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*{scrollbar-color:auto;scrollbar-width:auto}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.pointer-events-none{pointer-events:none}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.top-0{top:0}.z-10{z-index:10}.z-50{z-index:50}.my-2{margin-bottom:.5rem;margin-top:.5rem}.my-3{margin-bottom:.75rem;margin-top:.75rem}.-mt-4{margin-top:-1rem}.mb-5{margin-bottom:1.25rem}.ml-4{margin-left:1rem}.mr-2{margin-right:.5rem}.mr-4{margin-right:1rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.size-4{height:1rem;width:1rem}.h-0{height:0}.h-12{height:3rem}.h-2{height:.5rem}.h-4{height:1rem}.h-\\\\[20px\\\\]{height:20px}.h-\\\\[40px\\\\]{height:40px}.h-\\\\[6px\\\\]{height:6px}.h-full{height:100%}.min-h-72{min-height:18rem}.w-8{width:2rem}.w-\\\\[20px\\\\]{width:20px}.w-\\\\[400px\\\\]{width:400px}.w-\\\\[40px\\\\]{width:40px}.w-\\\\[60px\\\\]{width:60px}.w-full{width:100%}.min-w-\\\\[50px\\\\]{min-width:50px}.flex-grow{flex-grow:1}.basis-full{flex-basis:100%}@keyframes cpulse{50%{opacity:0}}.animate-cpulse{animation:cpulse 3.5s cubic-bezier(.4,0,.6,1) infinite}.cursor-pointer{cursor:pointer}.resize{resize:both}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-\\\\[10px\\\\]{gap:10px}.gap-\\\\[5px\\\\]{gap:5px}.overflow-x-scroll{overflow-x:scroll}.whitespace-nowrap{white-space:nowrap}.text-nowrap{text-wrap:nowrap}.rounded-\\\\[10px\\\\]{border-radius:10px}.rounded-\\\\[3px\\\\]{border-radius:3px}.rounded-full{border-radius:9999px}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity))}.border-gray-400{--tw-border-opacity:1;border-color:rgb(156 163 175/var(--tw-border-opacity))}.border-white{--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}.bg-\\\\[\\\\#2979ff\\\\]{--tw-bg-opacity:1;background-color:rgb(41 121 255/var(--tw-bg-opacity))}.bg-\\\\[\\\\#6c7a89\\\\]{--tw-bg-opacity:1;background-color:rgb(108 122 137/var(--tw-bg-opacity))}.bg-\\\\[\\\\#ddd\\\\]{--tw-bg-opacity:1;background-color:rgb(221 221 221/var(--tw-bg-opacity))}.bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.bg-gray-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity))}.bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.fill-white{fill:#fff}.p-\\\\[10px\\\\]{padding:10px}.px-1{padding-left:.25rem;padding-right:.25rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-top:.25rem}.pb-1,.py-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-6{padding-bottom:1.5rem}.pl-1{padding-left:.25rem}.pr-\\\\[0\\\\.125rem\\\\]{padding-right:.125rem}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.pt-6{padding-top:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.font-token{font-family:JetBrains Mono}.text-2xl{font-size:1.5rem;line-height:2rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-normal{font-weight:400}.uppercase{text-transform:uppercase}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.text-\\\\[\\\\#555\\\\]{--tw-text-opacity:1;color:rgb(85 85 85/var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity))}.text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity))}.text-purple-800{--tw-text-opacity:1;color:rgb(107 33 168/var(--tw-text-opacity))}.text-red-700{--tw-text-opacity:1;color:rgb(185 28 28/var(--tw-text-opacity))}.underline{text-decoration-line:underline}.line-through{text-decoration-line:line-through}.decoration-2{text-decoration-thickness:2px}.opacity-90{opacity:.9}.opacity-95{opacity:.95}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.scrollbar-thin::-webkit-scrollbar-track{background-color:var(--scrollbar-track);border-radius:var(--scrollbar-track-radius)}.scrollbar-thin::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb);border-radius:var(--scrollbar-thumb-radius)}.scrollbar-thin::-webkit-scrollbar-corner{background-color:var(--scrollbar-corner);border-radius:var(--scrollbar-corner-radius)}.scrollbar-thin{scrollbar-color:var(--scrollbar-thumb,initial) var(--scrollbar-track,initial);scrollbar-width:thin}.scrollbar-thin::-webkit-scrollbar{display:block;height:8px;width:8px}.scrollbar-track-gray-100{--scrollbar-track:#f3f4f6}.scrollbar-thumb-gray-200{--scrollbar-thumb:#e5e7eb}.hover\\\\:bg-gray-700:hover{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.hover\\\\:text-white:hover{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}');const it=[];function at(e,n=t){let r;const o=new Set;function a(t){if(i(e,t)&&(e=t,r)){const t=!it.length;for(const t of o)t[1](),it.push(t,e);if(t){for(let t=0;t<it.length;t+=2)it[t][0](it[t+1]);it.length=0}}}function l(t){a(t(e))}return{set:a,update:l,subscribe:function(i,s=t){const c=[i,s];return o.add(c),1===o.size&&(r=n(a,l)||t),i(e),()=>{o.delete(c),0===o.size&&r&&(r(),r=null)}}}}function lt(t){return null!=t&&\"RoleOpenerInput\"===t.class_name}function st(t){return null!=t&&\"TextOutput\"===t.class_name}function ct(t){return null!=t&&\"ImageOutput\"===t.class_name}function ut(t){return null!=t&&\"AudioOutput\"===t.class_name}function dt(t){return null!=t&&\"VideoOutput\"===t.class_name}var pt,ft=at(void 0),mt=at(void 0),gt=at(void 0);function ht(t){let e,n;return{c(){e=b(\"svg\"),n=b(\"polygon\"),k(n,\"points\",\"5,3 19,12 5,21\"),k(e,\"class\",\"fill-white w-[20px] h-[20px]\"),k(e,\"viewBox\",\"0 0 24 24\")},m(t,r){f(t,e,r),p(e,n)},d(t){t&&m(e)}}}function bt(t){let e,n,r;return{c(){e=b(\"svg\"),n=b(\"rect\"),r=b(\"rect\"),k(n,\"x\",\"6\"),k(n,\"y\",\"5\"),k(n,\"width\",\"4\"),k(n,\"height\",\"14\"),k(r,\"x\",\"14\"),k(r,\"y\",\"5\"),k(r,\"width\",\"4\"),k(r,\"height\",\"14\"),k(e,\"class\",\"fill-white w-[20px] h-[20px]\"),k(e,\"viewBox\",\"0 0 24 24\")},m(t,o){f(t,e,o),p(e,n),p(e,r)},d(t){t&&m(e)}}}function yt(e){let n,o,i,a,s,c,u,d,g,x,N,T,M,A,S,C,R,D,L,O,I,z,F,P,U,H=wt(e[5])+\"\",j=wt(e[4])+\"\";function q(t,e){return t[2]?bt:ht}let B=q(e),W=B(e);return{c(){n=h(\"div\"),o=h(\"div\"),i=h(\"div\"),W.c(),a=w(),s=h(\"div\"),c=h(\"canvas\"),u=w(),d=h(\"div\"),g=h(\"div\"),x=w(),N=h(\"div\"),T=y(H),M=y(\" / \"),A=y(j),S=w(),C=h(\"div\"),R=b(\"svg\"),D=b(\"path\"),L=w(),O=h(\"input\"),I=w(),z=h(\"audio\"),k(i,\"class\",\"w-[40px] h-[40px] rounded-full bg-[#6c7a89] flex items-center justify-center cursor-pointer\"),k(i,\"role\",\"button\"),k(i,\"tabindex\",\"0\"),k(i,\"aria-label\",\"Toggle playback\"),k(c,\"class\",\"w-full h-12\"),k(g,\"class\",\"h-full bg-[#2979ff] rounded-[3px] absolute\"),E(g,\"width\",e[3]+\"%\"),k(d,\"class\",\"h-[6px] bg-[#ddd] rounded-[3px] cursor-pointer relative\"),k(d,\"role\",\"slider\"),k(d,\"tabindex\",\"0\"),k(d,\"aria-label\",\"Seek\"),k(d,\"aria-valuemin\",\"0\"),k(d,\"aria-valuemax\",\"100\"),k(d,\"aria-valuenow\",e[3]),k(s,\"class\",\"flex flex-col flex-grow gap-1\"),k(N,\"class\",\"text-sm text-[#555] min-w-[50px]\"),k(D,\"d\",\"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.07c1.48-.74 2.5-2.26 2.5-4.04z\"),k(R,\"class\",\"w-[20px] h-[20px]\"),k(R,\"viewBox\",\"0 0 24 24\"),k(O,\"type\",\"range\"),k(O,\"min\",\"0\"),k(O,\"max\",\"1\"),k(O,\"step\",\"0.01\"),k(O,\"class\",\"w-[60px]\"),k(C,\"class\",\"flex items-center gap-[5px]\"),k(o,\"class\",\"flex items-center gap-[10px]\"),l(z.src,F=\"data:audio/wav;base64,\"+e[0])||k(z,\"src\",F),k(z,\"class\",\"hidden\"),k(n,\"class\",\"rounded-[10px] border border-gray-400 bg-white p-[10px] w-[400px]\")},m(t,r){f(t,n,r),p(n,o),p(o,i),W.m(i,null),p(o,a),p(o,s),p(s,c),e[13](c),p(s,u),p(s,d),p(d,g),p(o,x),p(o,N),p(N,T),p(N,M),p(N,A),p(o,S),p(o,C),p(C,R),p(R,D),p(C,L),p(C,O),$(O,e[6]),p(n,I),p(n,z),e[15](z),P||(U=[v(i,\"click\",e[8]),v(i,\"keydown\",e[8]),v(d,\"click\",e[10]),v(d,\"keydown\",e[10]),v(O,\"change\",e[14]),v(O,\"input\",e[14]),v(O,\"input\",e[11]),v(z,\"timeupdate\",e[9]),v(z,\"ended\",e[12])],P=!0)},p(t,[e]){B!==(B=q(t))&&(W.d(1),W=B(t),W&&(W.c(),W.m(i,null))),8&e&&E(g,\"width\",t[3]+\"%\"),8&e&&k(d,\"aria-valuenow\",t[3]),32&e&&H!==(H=wt(t[5])+\"\")&&_(T,H),16&e&&j!==(j=wt(t[4])+\"\")&&_(A,j),64&e&&$(O,t[6]),1&e&&!l(z.src,F=\"data:audio/wav;base64,\"+t[0])&&k(z,\"src\",F)},i:t,o:t,d(t){t&&m(n),W.d(),e[13](null),e[15](null),P=!1,r(U)}}}function wt(t){const e=Math.floor(t/60),n=Math.floor(t%60);return`${e}:${n<10?\"0\":\"\"}${n}`}function xt(t,e,n){let r,o,{audioData:i}=e,a=!1,l=0,s=0,c=0,u=1;async function d(){if(!i||!o)return;const t=new AudioContext,e=function(t){const e=atob(t),n=e.length,r=new Uint8Array(n);for(let t=0;t<n;t++)r[t]=e.charCodeAt(t);return r.buffer}(i);try{const n=(await t.decodeAudioData(e)).getChannelData(0),r=o;r.width=r.clientWidth,r.height=r.clientHeight;const i=r.width,a=r.height,l=i,s=Math.floor(n.length/l),c=new Array(l);for(let t=0;t<l;t++){let e=0;for(let r=0;r<s;r++)e+=Math.abs(n[t*s+r]);c[t]=e/s}const u=Math.max(...c),d=u>0?1/u:1,p=r.getContext(\"2d\");p.clearRect(0,0,i,a),p.fillStyle=\"#2979ff\";for(let t=0;t<l;t++){const e=t,n=c[t]*d*a,r=(a-n)/2;p.fillRect(e,r,1,n)}}catch(t){console.error(\"Error decoding audio for waveform:\",t)}}return C((()=>{d()})),t.$$set=t=>{\"audioData\"in t&&n(0,i=t.audioData)},[i,r,a,l,s,c,u,o,function(){r.paused?(r.play(),n(2,a=!0)):(r.pause(),n(2,a=!1))},function(){r&&(n(3,l=r.currentTime/r.duration*100),n(5,c=r.currentTime),n(4,s=r.duration||0))},function(t){const e=t.currentTarget,o=t.offsetX/e.offsetWidth*r.duration;n(1,r.currentTime=o,r)},function(t){n(6,u=t.target.value),n(1,r.volume=u,r)},function(){n(2,a=!1),n(3,l=0),n(5,c=0)},function(t){O[t?\"unshift\":\"push\"]((()=>{o=t,n(7,o)}))},function(){var t;t=this.value,u=\"\"===t?null:+t,n(6,u)},function(t){O[t?\"unshift\":\"push\"]((()=>{r=t,n(1,r)}))}]}!function(t){t.Running=\"Running\",t.Error=\"Error\",t.Done=\"Done\"}(pt||(pt={}));class vt extends rt{constructor(t){super(),nt(this,t,xt,yt,i,{audioData:0})}}function kt(t,e,n){const r=t.slice();return r[4]=e[n],r[6]=n,r}function _t(t){let e,n,r,o,i,a,l=t[4]+\"\",s=0===t[6]&&function(t){let e,n,r=t[0].role+\"\";return{c(){e=h(\"span\"),n=y(r),k(e,\"class\",\"absolute text-xs uppercase -mt-4 text-purple-800 font-sans\")},m(t,r){f(t,e,r),p(e,n)},p(t,e){1&e&&r!==(r=t[0].role+\"\")&&_(n,r)},d(t){t&&m(e)}}}(t);return{c(){e=h(\"span\"),s&&s.c(),n=w(),r=y(l),o=w(),k(e,\"data-index\",t[1]),k(e,\"role\",\"tooltip\"),k(e,\"class\",i=\"token-grid-item inline-block mt-2 border-b-2 \"+(t[0].special?\"text-gray-300\":\"\")),k(e,\"style\",a=`${t[2]} ${t[3]}`)},m(t,i){f(t,e,i),s&&s.m(e,null),p(e,n),p(e,r),p(e,o)},p(t,n){0===t[6]&&s.p(t,n),1&n&&l!==(l=t[4]+\"\")&&_(r,l),2&n&&k(e,\"data-index\",t[1]),1&n&&i!==(i=\"token-grid-item inline-block mt-2 border-b-2 \"+(t[0].special?\"text-gray-300\":\"\"))&&k(e,\"class\",i),12&n&&a!==(a=`${t[2]} ${t[3]}`)&&k(e,\"style\",a)},d(t){t&&m(e),s&&s.d()}}}function $t(t){let e,n,r,o,i,a=0===t[6]&&function(t){let e,n,r=t[0].role+\"\";return{c(){e=h(\"span\"),n=y(r),k(e,\"class\",\"absolute text-xs uppercase -mt-4 text-purple-800 font-sans\")},m(t,r){f(t,e,r),p(e,n)},p(t,e){1&e&&r!==(r=t[0].role+\"\")&&_(n,r)},d(t){t&&m(e)}}}(t);return{c(){e=h(\"span\"),a&&a.c(),n=y(\"\\n            \\\\n\"),o=w(),i=h(\"div\"),k(e,\"data-index\",t[1]),k(e,\"role\",\"tooltip\"),k(e,\"class\",\"token-grid-item inline-block mt-2 border-b-2 text-gray-300\"),k(e,\"style\",r=`${t[2]} ${t[3]}`),k(i,\"class\",\"basis-full h-full\")},m(t,r){f(t,e,r),a&&a.m(e,null),p(e,n),f(t,o,r),f(t,i,r)},p(t,n){0===t[6]&&a.p(t,n),2&n&&k(e,\"data-index\",t[1]),12&n&&r!==(r=`${t[2]} ${t[3]}`)&&k(e,\"style\",r)},d(t){t&&(m(e),m(o),m(i)),a&&a.d()}}}function Et(t){let e,n,r,o=0===t[6]&&function(t){let e,n,r=t[0].role+\"\";return{c(){e=h(\"span\"),n=y(r),k(e,\"class\",\"absolute text-xs uppercase -mt-4 text-purple-800 font-sans\")},m(t,r){f(t,e,r),p(e,n)},p(t,e){1&e&&r!==(r=t[0].role+\"\")&&_(n,r)},d(t){t&&m(e)}}}(t);return{c(){e=h(\"span\"),o&&o.c(),n=y(\"\\n            \\\\t  \\n        \"),k(e,\"data-index\",t[1]),k(e,\"role\",\"tooltip\"),k(e,\"class\",\"token-grid-item inline-block mt-2 border-b-2 text-gray-300\"),k(e,\"style\",r=`${t[2]} ${t[3]}`)},m(t,r){f(t,e,r),o&&o.m(e,null),p(e,n)},p(t,n){0===t[6]&&o.p(t,n),2&n&&k(e,\"data-index\",t[1]),12&n&&r!==(r=`${t[2]} ${t[3]}`)&&k(e,\"style\",r)},d(t){t&&m(e),o&&o.d()}}}function Nt(t){let e,n,r,o=0===t[6]&&function(t){let e,n,r=t[0].role+\"\";return{c(){e=h(\"span\"),n=y(r),k(e,\"class\",\"absolute text-xs uppercase -mt-4 text-purple-800 font-sans\")},m(t,r){f(t,e,r),p(e,n)},p(t,e){1&e&&r!==(r=t[0].role+\"\")&&_(n,r)},d(t){t&&m(e)}}}(t);return{c(){e=h(\"span\"),o&&o.c(),n=y(\"\\n             \\n        \"),k(e,\"data-index\",t[1]),k(e,\"role\",\"tooltip\"),k(e,\"class\",\"token-grid-item inline-block mt-2 border-b-2 text-gray-300\"),k(e,\"style\",r=`${t[2]} ${t[3]}`)},m(t,r){f(t,e,r),o&&o.m(e,null),p(e,n)},p(t,n){0===t[6]&&o.p(t,n),2&n&&k(e,\"data-index\",t[1]),12&n&&r!==(r=`${t[2]} ${t[3]}`)&&k(e,\"style\",r)},d(t){t&&m(e),o&&o.d()}}}function Tt(t){let e;function n(t,e){return\" \"===t[4]?Nt:\"\\t\"===t[4]?Et:\"\\n\"===t[4]?$t:_t}let r=n(t),o=r(t);return{c(){o.c(),e=x()},m(t,n){o.m(t,n),f(t,e,n)},p(t,i){r===(r=n(t))&&o?o.p(t,i):(o.d(1),o=r(t),o&&(o.c(),o.m(e.parentNode,e)))},d(t){t&&m(e),o.d(t)}}}function Mt(e){let n,r=K(e[0].text),o=[];for(let t=0;t<r.length;t+=1)o[t]=Tt(kt(e,r,t));return{c(){for(let t=0;t<o.length;t+=1)o[t].c();n=x()},m(t,e){for(let n=0;n<o.length;n+=1)o[n]&&o[n].m(t,e);f(t,n,e)},p(t,[e]){if(15&e){let i;for(r=K(t[0].text),i=0;i<r.length;i+=1){const a=kt(t,r,i);o[i]?o[i].p(a,e):(o[i]=Tt(a),o[i].c(),o[i].m(n.parentNode,n))}for(;i<o.length;i+=1)o[i].d(1);o.length=r.length}},i:t,o:t,d(t){t&&m(n),g(o,t)}}}function At(t,e,n){let{token:r}=e,{index:o}=e,{underlineStyle:i=\"\"}=e,{bgStyle:a=\"\"}=e;return t.$$set=t=>{\"token\"in t&&n(0,r=t.token),\"index\"in t&&n(1,o=t.index),\"underlineStyle\"in t&&n(2,i=t.underlineStyle),\"bgStyle\"in t&&n(3,a=t.bgStyle)},[r,o,i,a]}class St extends rt{constructor(t){super(),nt(this,t,At,Mt,i,{token:0,index:1,underlineStyle:2,bgStyle:3})}}function Ct(t,e){var n,r=function(r){n=setTimeout((function(){t.dispatchEvent(new CustomEvent(\"longmouseover\",{detail:r}))}),e)},o=function(e){clearTimeout(n),t.dispatchEvent(new CustomEvent(\"longmouseout\",{detail:e}))};return t.addEventListener(\"mouseover\",r),t.addEventListener(\"mouseout\",o),{update:function(t){e=t},destroy:function(){t.removeEventListener(\"mouseover\",r),t.removeEventListener(\"mouseout\",o)}}}\"undefined\"!=typeof globalThis?globalThis:\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self&&self;function Rt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,\"default\")?t.default:t}var Dt={exports:{}};\n/*! @license DOMPurify 3.1.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.7/LICENSE */Dt.exports=function(){const{entries:t,setPrototypeOf:e,isFrozen:n,getPrototypeOf:r,getOwnPropertyDescriptor:o}=Object;let{freeze:i,seal:a,create:l}=Object,{apply:s,construct:c}=\"undefined\"!=typeof Reflect&&Reflect;i||(i=function(t){return t}),a||(a=function(t){return t}),s||(s=function(t,e,n){return t.apply(e,n)}),c||(c=function(t,e){return new t(...e)});const u=k(Array.prototype.forEach),d=k(Array.prototype.pop),p=k(Array.prototype.push),f=k(String.prototype.toLowerCase),m=k(String.prototype.toString),g=k(String.prototype.match),h=k(String.prototype.replace),b=k(String.prototype.indexOf),y=k(String.prototype.trim),w=k(Object.prototype.hasOwnProperty),x=k(RegExp.prototype.test),v=_(TypeError);function k(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return s(t,e,r)}}function _(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return c(t,n)}}function $(t,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:f;e&&e(t,null);let i=r.length;for(;i--;){let e=r[i];if(\"string\"==typeof e){const t=o(e);t!==e&&(n(r)||(r[i]=t),e=t)}t[e]=!0}return t}function E(t){for(let e=0;e<t.length;e++)w(t,e)||(t[e]=null);return t}function N(e){const n=l(null);for(const[r,o]of t(e))w(e,r)&&(Array.isArray(o)?n[r]=E(o):o&&\"object\"==typeof o&&o.constructor===Object?n[r]=N(o):n[r]=o);return n}function T(t,e){for(;null!==t;){const n=o(t,e);if(n){if(n.get)return k(n.get);if(\"function\"==typeof n.value)return k(n.value)}t=r(t)}function n(){return null}return n}const M=i([\"a\",\"abbr\",\"acronym\",\"address\",\"area\",\"article\",\"aside\",\"audio\",\"b\",\"bdi\",\"bdo\",\"big\",\"blink\",\"blockquote\",\"body\",\"br\",\"button\",\"canvas\",\"caption\",\"center\",\"cite\",\"code\",\"col\",\"colgroup\",\"content\",\"data\",\"datalist\",\"dd\",\"decorator\",\"del\",\"details\",\"dfn\",\"dialog\",\"dir\",\"div\",\"dl\",\"dt\",\"element\",\"em\",\"fieldset\",\"figcaption\",\"figure\",\"font\",\"footer\",\"form\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"head\",\"header\",\"hgroup\",\"hr\",\"html\",\"i\",\"img\",\"input\",\"ins\",\"kbd\",\"label\",\"legend\",\"li\",\"main\",\"map\",\"mark\",\"marquee\",\"menu\",\"menuitem\",\"meter\",\"nav\",\"nobr\",\"ol\",\"optgroup\",\"option\",\"output\",\"p\",\"picture\",\"pre\",\"progress\",\"q\",\"rp\",\"rt\",\"ruby\",\"s\",\"samp\",\"section\",\"select\",\"shadow\",\"small\",\"source\",\"spacer\",\"span\",\"strike\",\"strong\",\"style\",\"sub\",\"summary\",\"sup\",\"table\",\"tbody\",\"td\",\"template\",\"textarea\",\"tfoot\",\"th\",\"thead\",\"time\",\"tr\",\"track\",\"tt\",\"u\",\"ul\",\"var\",\"video\",\"wbr\"]),A=i([\"svg\",\"a\",\"altglyph\",\"altglyphdef\",\"altglyphitem\",\"animatecolor\",\"animatemotion\",\"animatetransform\",\"circle\",\"clippath\",\"defs\",\"desc\",\"ellipse\",\"filter\",\"font\",\"g\",\"glyph\",\"glyphref\",\"hkern\",\"image\",\"line\",\"lineargradient\",\"marker\",\"mask\",\"metadata\",\"mpath\",\"path\",\"pattern\",\"polygon\",\"polyline\",\"radialgradient\",\"rect\",\"stop\",\"style\",\"switch\",\"symbol\",\"text\",\"textpath\",\"title\",\"tref\",\"tspan\",\"view\",\"vkern\"]),S=i([\"feBlend\",\"feColorMatrix\",\"feComponentTransfer\",\"feComposite\",\"feConvolveMatrix\",\"feDiffuseLighting\",\"feDisplacementMap\",\"feDistantLight\",\"feDropShadow\",\"feFlood\",\"feFuncA\",\"feFuncB\",\"feFuncG\",\"feFuncR\",\"feGaussianBlur\",\"feImage\",\"feMerge\",\"feMergeNode\",\"feMorphology\",\"feOffset\",\"fePointLight\",\"feSpecularLighting\",\"feSpotLight\",\"feTile\",\"feTurbulence\"]),C=i([\"animate\",\"color-profile\",\"cursor\",\"discard\",\"font-face\",\"font-face-format\",\"font-face-name\",\"font-face-src\",\"font-face-uri\",\"foreignobject\",\"hatch\",\"hatchpath\",\"mesh\",\"meshgradient\",\"meshpatch\",\"meshrow\",\"missing-glyph\",\"script\",\"set\",\"solidcolor\",\"unknown\",\"use\"]),R=i([\"math\",\"menclose\",\"merror\",\"mfenced\",\"mfrac\",\"mglyph\",\"mi\",\"mlabeledtr\",\"mmultiscripts\",\"mn\",\"mo\",\"mover\",\"mpadded\",\"mphantom\",\"mroot\",\"mrow\",\"ms\",\"mspace\",\"msqrt\",\"mstyle\",\"msub\",\"msup\",\"msubsup\",\"mtable\",\"mtd\",\"mtext\",\"mtr\",\"munder\",\"munderover\",\"mprescripts\"]),D=i([\"maction\",\"maligngroup\",\"malignmark\",\"mlongdiv\",\"mscarries\",\"mscarry\",\"msgroup\",\"mstack\",\"msline\",\"msrow\",\"semantics\",\"annotation\",\"annotation-xml\",\"mprescripts\",\"none\"]),L=i([\"#text\"]),O=i([\"accept\",\"action\",\"align\",\"alt\",\"autocapitalize\",\"autocomplete\",\"autopictureinpicture\",\"autoplay\",\"background\",\"bgcolor\",\"border\",\"capture\",\"cellpadding\",\"cellspacing\",\"checked\",\"cite\",\"class\",\"clear\",\"color\",\"cols\",\"colspan\",\"controls\",\"controlslist\",\"coords\",\"crossorigin\",\"datetime\",\"decoding\",\"default\",\"dir\",\"disabled\",\"disablepictureinpicture\",\"disableremoteplayback\",\"download\",\"draggable\",\"enctype\",\"enterkeyhint\",\"face\",\"for\",\"headers\",\"height\",\"hidden\",\"high\",\"href\",\"hreflang\",\"id\",\"inputmode\",\"integrity\",\"ismap\",\"kind\",\"label\",\"lang\",\"list\",\"loading\",\"loop\",\"low\",\"max\",\"maxlength\",\"media\",\"method\",\"min\",\"minlength\",\"multiple\",\"muted\",\"name\",\"nonce\",\"noshade\",\"novalidate\",\"nowrap\",\"open\",\"optimum\",\"pattern\",\"placeholder\",\"playsinline\",\"popover\",\"popovertarget\",\"popovertargetaction\",\"poster\",\"preload\",\"pubdate\",\"radiogroup\",\"readonly\",\"rel\",\"required\",\"rev\",\"reversed\",\"role\",\"rows\",\"rowspan\",\"spellcheck\",\"scope\",\"selected\",\"shape\",\"size\",\"sizes\",\"span\",\"srclang\",\"start\",\"src\",\"srcset\",\"step\",\"style\",\"summary\",\"tabindex\",\"title\",\"translate\",\"type\",\"usemap\",\"valign\",\"value\",\"width\",\"wrap\",\"xmlns\",\"slot\"]),I=i([\"accent-height\",\"accumulate\",\"additive\",\"alignment-baseline\",\"amplitude\",\"ascent\",\"attributename\",\"attributetype\",\"azimuth\",\"basefrequency\",\"baseline-shift\",\"begin\",\"bias\",\"by\",\"class\",\"clip\",\"clippathunits\",\"clip-path\",\"clip-rule\",\"color\",\"color-interpolation\",\"color-interpolation-filters\",\"color-profile\",\"color-rendering\",\"cx\",\"cy\",\"d\",\"dx\",\"dy\",\"diffuseconstant\",\"direction\",\"display\",\"divisor\",\"dur\",\"edgemode\",\"elevation\",\"end\",\"exponent\",\"fill\",\"fill-opacity\",\"fill-rule\",\"filter\",\"filterunits\",\"flood-color\",\"flood-opacity\",\"font-family\",\"font-size\",\"font-size-adjust\",\"font-stretch\",\"font-style\",\"font-variant\",\"font-weight\",\"fx\",\"fy\",\"g1\",\"g2\",\"glyph-name\",\"glyphref\",\"gradientunits\",\"gradienttransform\",\"height\",\"href\",\"id\",\"image-rendering\",\"in\",\"in2\",\"intercept\",\"k\",\"k1\",\"k2\",\"k3\",\"k4\",\"kerning\",\"keypoints\",\"keysplines\",\"keytimes\",\"lang\",\"lengthadjust\",\"letter-spacing\",\"kernelmatrix\",\"kernelunitlength\",\"lighting-color\",\"local\",\"marker-end\",\"marker-mid\",\"marker-start\",\"markerheight\",\"markerunits\",\"markerwidth\",\"maskcontentunits\",\"maskunits\",\"max\",\"mask\",\"media\",\"method\",\"mode\",\"min\",\"name\",\"numoctaves\",\"offset\",\"operator\",\"opacity\",\"order\",\"orient\",\"orientation\",\"origin\",\"overflow\",\"paint-order\",\"path\",\"pathlength\",\"patterncontentunits\",\"patterntransform\",\"patternunits\",\"points\",\"preservealpha\",\"preserveaspectratio\",\"primitiveunits\",\"r\",\"rx\",\"ry\",\"radius\",\"refx\",\"refy\",\"repeatcount\",\"repeatdur\",\"restart\",\"result\",\"rotate\",\"scale\",\"seed\",\"shape-rendering\",\"slope\",\"specularconstant\",\"specularexponent\",\"spreadmethod\",\"startoffset\",\"stddeviation\",\"stitchtiles\",\"stop-color\",\"stop-opacity\",\"stroke-dasharray\",\"stroke-dashoffset\",\"stroke-linecap\",\"stroke-linejoin\",\"stroke-miterlimit\",\"stroke-opacity\",\"stroke\",\"stroke-width\",\"style\",\"surfacescale\",\"systemlanguage\",\"tabindex\",\"tablevalues\",\"targetx\",\"targety\",\"transform\",\"transform-origin\",\"text-anchor\",\"text-decoration\",\"text-rendering\",\"textlength\",\"type\",\"u1\",\"u2\",\"unicode\",\"values\",\"viewbox\",\"visibility\",\"version\",\"vert-adv-y\",\"vert-origin-x\",\"vert-origin-y\",\"width\",\"word-spacing\",\"wrap\",\"writing-mode\",\"xchannelselector\",\"ychannelselector\",\"x\",\"x1\",\"x2\",\"xmlns\",\"y\",\"y1\",\"y2\",\"z\",\"zoomandpan\"]),z=i([\"accent\",\"accentunder\",\"align\",\"bevelled\",\"close\",\"columnsalign\",\"columnlines\",\"columnspan\",\"denomalign\",\"depth\",\"dir\",\"display\",\"displaystyle\",\"encoding\",\"fence\",\"frame\",\"height\",\"href\",\"id\",\"largeop\",\"length\",\"linethickness\",\"lspace\",\"lquote\",\"mathbackground\",\"mathcolor\",\"mathsize\",\"mathvariant\",\"maxsize\",\"minsize\",\"movablelimits\",\"notation\",\"numalign\",\"open\",\"rowalign\",\"rowlines\",\"rowspacing\",\"rowspan\",\"rspace\",\"rquote\",\"scriptlevel\",\"scriptminsize\",\"scriptsizemultiplier\",\"selection\",\"separator\",\"separators\",\"stretchy\",\"subscriptshift\",\"supscriptshift\",\"symmetric\",\"voffset\",\"width\",\"xmlns\"]),F=i([\"xlink:href\",\"xml:id\",\"xlink:title\",\"xml:space\",\"xmlns:xlink\"]),P=a(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm),U=a(/<%[\\w\\W]*|[\\w\\W]*%>/gm),H=a(/\\${[\\w\\W]*}/gm),j=a(/^data-[\\-\\w.\\u00B7-\\uFFFF]/),q=a(/^aria-[\\-\\w]+$/),B=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i),W=a(/^(?:\\w+script|data):/i),G=a(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g),Y=a(/^html$/i),V=a(/^[a-z][.\\w]*(-[.\\w]+)+$/i);var X=Object.freeze({__proto__:null,MUSTACHE_EXPR:P,ERB_EXPR:U,TMPLIT_EXPR:H,DATA_ATTR:j,ARIA_ATTR:q,IS_ALLOWED_URI:B,IS_SCRIPT_OR_DATA:W,ATTR_WHITESPACE:G,DOCTYPE_NAME:Y,CUSTOM_ELEMENT:V});const J={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},K=function(){return\"undefined\"==typeof window?null:window},Z=function(t,e){if(\"object\"!=typeof t||\"function\"!=typeof t.createPolicy)return null;let n=null;const r=\"data-tt-policy-suffix\";e&&e.hasAttribute(r)&&(n=e.getAttribute(r));const o=\"dompurify\"+(n?\"#\"+n:\"\");try{return t.createPolicy(o,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return console.warn(\"TrustedTypes policy \"+o+\" could not be created.\"),null}};function Q(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:K();const n=t=>Q(t);if(n.version=\"3.1.7\",n.removed=[],!e||!e.document||e.document.nodeType!==J.document)return n.isSupported=!1,n;let{document:r}=e;const o=r,a=o.currentScript,{DocumentFragment:s,HTMLTemplateElement:c,Node:k,Element:_,NodeFilter:E,NamedNodeMap:P=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:U,DOMParser:H,trustedTypes:j}=e,q=_.prototype,W=T(q,\"cloneNode\"),G=T(q,\"remove\"),V=T(q,\"nextSibling\"),tt=T(q,\"childNodes\"),et=T(q,\"parentNode\");if(\"function\"==typeof c){const t=r.createElement(\"template\");t.content&&t.content.ownerDocument&&(r=t.content.ownerDocument)}let nt,rt=\"\";const{implementation:ot,createNodeIterator:it,createDocumentFragment:at,getElementsByTagName:lt}=r,{importNode:st}=o;let ct={};n.isSupported=\"function\"==typeof t&&\"function\"==typeof et&&ot&&void 0!==ot.createHTMLDocument;const{MUSTACHE_EXPR:ut,ERB_EXPR:dt,TMPLIT_EXPR:pt,DATA_ATTR:ft,ARIA_ATTR:mt,IS_SCRIPT_OR_DATA:gt,ATTR_WHITESPACE:ht,CUSTOM_ELEMENT:bt}=X;let{IS_ALLOWED_URI:yt}=X,wt=null;const xt=$({},[...M,...A,...S,...R,...L]);let vt=null;const kt=$({},[...O,...I,...z,...F]);let _t=Object.seal(l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$t=null,Et=null,Nt=!0,Tt=!0,Mt=!1,At=!0,St=!1,Ct=!0,Rt=!1,Dt=!1,Lt=!1,Ot=!1,It=!1,zt=!1,Ft=!0,Pt=!1;const Ut=\"user-content-\";let Ht=!0,jt=!1,qt={},Bt=null;const Wt=$({},[\"annotation-xml\",\"audio\",\"colgroup\",\"desc\",\"foreignobject\",\"head\",\"iframe\",\"math\",\"mi\",\"mn\",\"mo\",\"ms\",\"mtext\",\"noembed\",\"noframes\",\"noscript\",\"plaintext\",\"script\",\"style\",\"svg\",\"template\",\"thead\",\"title\",\"video\",\"xmp\"]);let Gt=null;const Yt=$({},[\"audio\",\"video\",\"img\",\"source\",\"image\",\"track\"]);let Vt=null;const Xt=$({},[\"alt\",\"class\",\"for\",\"id\",\"label\",\"name\",\"pattern\",\"placeholder\",\"role\",\"summary\",\"title\",\"value\",\"style\",\"xmlns\"]),Jt=\"http://www.w3.org/1998/Math/MathML\",Kt=\"http://www.w3.org/2000/svg\",Zt=\"http://www.w3.org/1999/xhtml\";let Qt=Zt,te=!1,ee=null;const ne=$({},[Jt,Kt,Zt],m);let re=null;const oe=[\"application/xhtml+xml\",\"text/html\"],ie=\"text/html\";let ae=null,le=null;const se=r.createElement(\"form\"),ce=function(t){return t instanceof RegExp||t instanceof Function},ue=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!le||le!==t){if(t&&\"object\"==typeof t||(t={}),t=N(t),re=-1===oe.indexOf(t.PARSER_MEDIA_TYPE)?ie:t.PARSER_MEDIA_TYPE,ae=\"application/xhtml+xml\"===re?m:f,wt=w(t,\"ALLOWED_TAGS\")?$({},t.ALLOWED_TAGS,ae):xt,vt=w(t,\"ALLOWED_ATTR\")?$({},t.ALLOWED_ATTR,ae):kt,ee=w(t,\"ALLOWED_NAMESPACES\")?$({},t.ALLOWED_NAMESPACES,m):ne,Vt=w(t,\"ADD_URI_SAFE_ATTR\")?$(N(Xt),t.ADD_URI_SAFE_ATTR,ae):Xt,Gt=w(t,\"ADD_DATA_URI_TAGS\")?$(N(Yt),t.ADD_DATA_URI_TAGS,ae):Yt,Bt=w(t,\"FORBID_CONTENTS\")?$({},t.FORBID_CONTENTS,ae):Wt,$t=w(t,\"FORBID_TAGS\")?$({},t.FORBID_TAGS,ae):{},Et=w(t,\"FORBID_ATTR\")?$({},t.FORBID_ATTR,ae):{},qt=!!w(t,\"USE_PROFILES\")&&t.USE_PROFILES,Nt=!1!==t.ALLOW_ARIA_ATTR,Tt=!1!==t.ALLOW_DATA_ATTR,Mt=t.ALLOW_UNKNOWN_PROTOCOLS||!1,At=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,St=t.SAFE_FOR_TEMPLATES||!1,Ct=!1!==t.SAFE_FOR_XML,Rt=t.WHOLE_DOCUMENT||!1,Ot=t.RETURN_DOM||!1,It=t.RETURN_DOM_FRAGMENT||!1,zt=t.RETURN_TRUSTED_TYPE||!1,Lt=t.FORCE_BODY||!1,Ft=!1!==t.SANITIZE_DOM,Pt=t.SANITIZE_NAMED_PROPS||!1,Ht=!1!==t.KEEP_CONTENT,jt=t.IN_PLACE||!1,yt=t.ALLOWED_URI_REGEXP||B,Qt=t.NAMESPACE||Zt,_t=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&ce(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(_t.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&ce(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(_t.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&\"boolean\"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(_t.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),St&&(Tt=!1),It&&(Ot=!0),qt&&(wt=$({},L),vt=[],!0===qt.html&&($(wt,M),$(vt,O)),!0===qt.svg&&($(wt,A),$(vt,I),$(vt,F)),!0===qt.svgFilters&&($(wt,S),$(vt,I),$(vt,F)),!0===qt.mathMl&&($(wt,R),$(vt,z),$(vt,F))),t.ADD_TAGS&&(wt===xt&&(wt=N(wt)),$(wt,t.ADD_TAGS,ae)),t.ADD_ATTR&&(vt===kt&&(vt=N(vt)),$(vt,t.ADD_ATTR,ae)),t.ADD_URI_SAFE_ATTR&&$(Vt,t.ADD_URI_SAFE_ATTR,ae),t.FORBID_CONTENTS&&(Bt===Wt&&(Bt=N(Bt)),$(Bt,t.FORBID_CONTENTS,ae)),Ht&&(wt[\"#text\"]=!0),Rt&&$(wt,[\"html\",\"head\",\"body\"]),wt.table&&($(wt,[\"tbody\"]),delete $t.tbody),t.TRUSTED_TYPES_POLICY){if(\"function\"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw v('TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.');if(\"function\"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw v('TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.');nt=t.TRUSTED_TYPES_POLICY,rt=nt.createHTML(\"\")}else void 0===nt&&(nt=Z(j,a)),null!==nt&&\"string\"==typeof rt&&(rt=nt.createHTML(\"\"));i&&i(t),le=t}},de=$({},[\"mi\",\"mo\",\"mn\",\"ms\",\"mtext\"]),pe=$({},[\"annotation-xml\"]),fe=$({},[\"title\",\"style\",\"font\",\"a\",\"script\"]),me=$({},[...A,...S,...C]),ge=$({},[...R,...D]),he=function(t){let e=et(t);e&&e.tagName||(e={namespaceURI:Qt,tagName:\"template\"});const n=f(t.tagName),r=f(e.tagName);return!!ee[t.namespaceURI]&&(t.namespaceURI===Kt?e.namespaceURI===Zt?\"svg\"===n:e.namespaceURI===Jt?\"svg\"===n&&(\"annotation-xml\"===r||de[r]):Boolean(me[n]):t.namespaceURI===Jt?e.namespaceURI===Zt?\"math\"===n:e.namespaceURI===Kt?\"math\"===n&&pe[r]:Boolean(ge[n]):t.namespaceURI===Zt?!(e.namespaceURI===Kt&&!pe[r])&&!(e.namespaceURI===Jt&&!de[r])&&!ge[n]&&(fe[n]||!me[n]):!(\"application/xhtml+xml\"!==re||!ee[t.namespaceURI]))},be=function(t){p(n.removed,{element:t});try{et(t).removeChild(t)}catch(e){G(t)}},ye=function(t,e){try{p(n.removed,{attribute:e.getAttributeNode(t),from:e})}catch(t){p(n.removed,{attribute:null,from:e})}if(e.removeAttribute(t),\"is\"===t&&!vt[t])if(Ot||It)try{be(e)}catch(t){}else try{e.setAttribute(t,\"\")}catch(t){}},we=function(t){let e=null,n=null;if(Lt)t=\"<remove></remove>\"+t;else{const e=g(t,/^[\\r\\n\\t ]+/);n=e&&e[0]}\"application/xhtml+xml\"===re&&Qt===Zt&&(t='<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>'+t+\"</body></html>\");const o=nt?nt.createHTML(t):t;if(Qt===Zt)try{e=(new H).parseFromString(o,re)}catch(t){}if(!e||!e.documentElement){e=ot.createDocument(Qt,\"template\",null);try{e.documentElement.innerHTML=te?rt:o}catch(t){}}const i=e.body||e.documentElement;return t&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),Qt===Zt?lt.call(e,Rt?\"html\":\"body\")[0]:Rt?e.documentElement:i},xe=function(t){return it.call(t.ownerDocument||t,t,E.SHOW_ELEMENT|E.SHOW_COMMENT|E.SHOW_TEXT|E.SHOW_PROCESSING_INSTRUCTION|E.SHOW_CDATA_SECTION,null)},ve=function(t){return t instanceof U&&(\"string\"!=typeof t.nodeName||\"string\"!=typeof t.textContent||\"function\"!=typeof t.removeChild||!(t.attributes instanceof P)||\"function\"!=typeof t.removeAttribute||\"function\"!=typeof t.setAttribute||\"string\"!=typeof t.namespaceURI||\"function\"!=typeof t.insertBefore||\"function\"!=typeof t.hasChildNodes)},ke=function(t){return\"function\"==typeof k&&t instanceof k},_e=function(t,e,r){ct[t]&&u(ct[t],(t=>{t.call(n,e,r,le)}))},$e=function(t){let e=null;if(_e(\"beforeSanitizeElements\",t,null),ve(t))return be(t),!0;const r=ae(t.nodeName);if(_e(\"uponSanitizeElement\",t,{tagName:r,allowedTags:wt}),t.hasChildNodes()&&!ke(t.firstElementChild)&&x(/<[/\\w]/g,t.innerHTML)&&x(/<[/\\w]/g,t.textContent))return be(t),!0;if(t.nodeType===J.progressingInstruction)return be(t),!0;if(Ct&&t.nodeType===J.comment&&x(/<[/\\w]/g,t.data))return be(t),!0;if(!wt[r]||$t[r]){if(!$t[r]&&Ne(r)){if(_t.tagNameCheck instanceof RegExp&&x(_t.tagNameCheck,r))return!1;if(_t.tagNameCheck instanceof Function&&_t.tagNameCheck(r))return!1}if(Ht&&!Bt[r]){const e=et(t)||t.parentNode,n=tt(t)||t.childNodes;if(n&&e)for(let r=n.length-1;r>=0;--r){const o=W(n[r],!0);o.__removalCount=(t.__removalCount||0)+1,e.insertBefore(o,V(t))}}return be(t),!0}return t instanceof _&&!he(t)?(be(t),!0):\"noscript\"!==r&&\"noembed\"!==r&&\"noframes\"!==r||!x(/<\\/no(script|embed|frames)/i,t.innerHTML)?(St&&t.nodeType===J.text&&(e=t.textContent,u([ut,dt,pt],(t=>{e=h(e,t,\" \")})),t.textContent!==e&&(p(n.removed,{element:t.cloneNode()}),t.textContent=e)),_e(\"afterSanitizeElements\",t,null),!1):(be(t),!0)},Ee=function(t,e,n){if(Ft&&(\"id\"===e||\"name\"===e)&&(n in r||n in se))return!1;if(Tt&&!Et[e]&&x(ft,e));else if(Nt&&x(mt,e));else if(!vt[e]||Et[e]){if(!(Ne(t)&&(_t.tagNameCheck instanceof RegExp&&x(_t.tagNameCheck,t)||_t.tagNameCheck instanceof Function&&_t.tagNameCheck(t))&&(_t.attributeNameCheck instanceof RegExp&&x(_t.attributeNameCheck,e)||_t.attributeNameCheck instanceof Function&&_t.attributeNameCheck(e))||\"is\"===e&&_t.allowCustomizedBuiltInElements&&(_t.tagNameCheck instanceof RegExp&&x(_t.tagNameCheck,n)||_t.tagNameCheck instanceof Function&&_t.tagNameCheck(n))))return!1}else if(Vt[e]);else if(x(yt,h(n,ht,\"\")));else if(\"src\"!==e&&\"xlink:href\"!==e&&\"href\"!==e||\"script\"===t||0!==b(n,\"data:\")||!Gt[t])if(Mt&&!x(gt,h(n,ht,\"\")));else if(n)return!1;return!0},Ne=function(t){return\"annotation-xml\"!==t&&g(t,bt)},Te=function(t){_e(\"beforeSanitizeAttributes\",t,null);const{attributes:e}=t;if(!e)return;const r={attrName:\"\",attrValue:\"\",keepAttr:!0,allowedAttributes:vt};let o=e.length;for(;o--;){const i=e[o],{name:a,namespaceURI:l,value:s}=i,c=ae(a);let p=\"value\"===a?s:y(s);if(r.attrName=c,r.attrValue=p,r.keepAttr=!0,r.forceKeepAttr=void 0,_e(\"uponSanitizeAttribute\",t,r),p=r.attrValue,r.forceKeepAttr)continue;if(ye(a,t),!r.keepAttr)continue;if(!At&&x(/\\/>/i,p)){ye(a,t);continue}St&&u([ut,dt,pt],(t=>{p=h(p,t,\" \")}));const f=ae(t.nodeName);if(Ee(f,c,p))if(!Pt||\"id\"!==c&&\"name\"!==c||(ye(a,t),p=Ut+p),Ct&&x(/((--!?|])>)|<\\/(style|title)/i,p))ye(a,t);else{if(nt&&\"object\"==typeof j&&\"function\"==typeof j.getAttributeType)if(l);else switch(j.getAttributeType(f,c)){case\"TrustedHTML\":p=nt.createHTML(p);break;case\"TrustedScriptURL\":p=nt.createScriptURL(p)}try{l?t.setAttributeNS(l,a,p):t.setAttribute(a,p),ve(t)?be(t):d(n.removed)}catch(t){}}}_e(\"afterSanitizeAttributes\",t,null)},Me=function t(e){let n=null;const r=xe(e);for(_e(\"beforeSanitizeShadowDOM\",e,null);n=r.nextNode();)_e(\"uponSanitizeShadowNode\",n,null),$e(n)||(n.content instanceof s&&t(n.content),Te(n));_e(\"afterSanitizeShadowDOM\",e,null)};return n.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,a=null,l=null;if(te=!t,te&&(t=\"\\x3c!--\\x3e\"),\"string\"!=typeof t&&!ke(t)){if(\"function\"!=typeof t.toString)throw v(\"toString is not a function\");if(\"string\"!=typeof(t=t.toString()))throw v(\"dirty is not a string, aborting\")}if(!n.isSupported)return t;if(Dt||ue(e),n.removed=[],\"string\"==typeof t&&(jt=!1),jt){if(t.nodeName){const e=ae(t.nodeName);if(!wt[e]||$t[e])throw v(\"root node is forbidden and cannot be sanitized in-place\")}}else if(t instanceof k)r=we(\"\\x3c!----\\x3e\"),i=r.ownerDocument.importNode(t,!0),i.nodeType===J.element&&\"BODY\"===i.nodeName||\"HTML\"===i.nodeName?r=i:r.appendChild(i);else{if(!Ot&&!St&&!Rt&&-1===t.indexOf(\"<\"))return nt&&zt?nt.createHTML(t):t;if(r=we(t),!r)return Ot?null:zt?rt:\"\"}r&&Lt&&be(r.firstChild);const c=xe(jt?t:r);for(;a=c.nextNode();)$e(a)||(a.content instanceof s&&Me(a.content),Te(a));if(jt)return t;if(Ot){if(It)for(l=at.call(r.ownerDocument);r.firstChild;)l.appendChild(r.firstChild);else l=r;return(vt.shadowroot||vt.shadowrootmode)&&(l=st.call(o,l,!0)),l}let d=Rt?r.outerHTML:r.innerHTML;return Rt&&wt[\"!doctype\"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&x(Y,r.ownerDocument.doctype.name)&&(d=\"<!DOCTYPE \"+r.ownerDocument.doctype.name+\">\\n\"+d),St&&u([ut,dt,pt],(t=>{d=h(d,t,\" \")})),nt&&zt?nt.createHTML(d):d},n.setConfig=function(){ue(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Dt=!0},n.clearConfig=function(){le=null,Dt=!1},n.isValidAttribute=function(t,e,n){le||ue({});const r=ae(t),o=ae(e);return Ee(r,o,n)},n.addHook=function(t,e){\"function\"==typeof e&&(ct[t]=ct[t]||[],p(ct[t],e))},n.removeHook=function(t){if(ct[t])return d(ct[t])},n.removeHooks=function(t){ct[t]&&(ct[t]=[])},n.removeAllHooks=function(){ct={}},n}var tt=Q();return tt}();var Lt=Rt(Dt.exports);function Ot(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]=\"#\"+t.slice(6*r,6*++r);return n}function It(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function zt(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Ft(){}var Pt=.7,Ut=1/Pt,Ht=\"\\\\s*([+-]?\\\\d+)\\\\s*\",jt=\"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",qt=\"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",Bt=/^#([0-9a-f]{3,8})$/,Wt=new RegExp(`^rgb\\\\(${Ht},${Ht},${Ht}\\\\)$`),Gt=new RegExp(`^rgb\\\\(${qt},${qt},${qt}\\\\)$`),Yt=new RegExp(`^rgba\\\\(${Ht},${Ht},${Ht},${jt}\\\\)$`),Vt=new RegExp(`^rgba\\\\(${qt},${qt},${qt},${jt}\\\\)$`),Xt=new RegExp(`^hsl\\\\(${jt},${qt},${qt}\\\\)$`),Jt=new RegExp(`^hsla\\\\(${jt},${qt},${qt},${jt}\\\\)$`),Kt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Zt(){return this.rgb().formatHex()}function Qt(){return this.rgb().formatRgb()}function te(t){var e,n;return t=(t+\"\").trim().toLowerCase(),(e=Bt.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?ee(e):3===n?new oe(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?ne(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?ne(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Wt.exec(t))?new oe(e[1],e[2],e[3],1):(e=Gt.exec(t))?new oe(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Yt.exec(t))?ne(e[1],e[2],e[3],e[4]):(e=Vt.exec(t))?ne(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Xt.exec(t))?ue(e[1],e[2]/100,e[3]/100,1):(e=Jt.exec(t))?ue(e[1],e[2]/100,e[3]/100,e[4]):Kt.hasOwnProperty(t)?ee(Kt[t]):\"transparent\"===t?new oe(NaN,NaN,NaN,0):null}function ee(t){return new oe(t>>16&255,t>>8&255,255&t,1)}function ne(t,e,n,r){return r<=0&&(t=e=n=NaN),new oe(t,e,n,r)}function re(t,e,n,r){return 1===arguments.length?((o=t)instanceof Ft||(o=te(o)),o?new oe((o=o.rgb()).r,o.g,o.b,o.opacity):new oe):new oe(t,e,n,null==r?1:r);var o}function oe(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function ie(){return`#${ce(this.r)}${ce(this.g)}${ce(this.b)}`}function ae(){const t=le(this.opacity);return`${1===t?\"rgb(\":\"rgba(\"}${se(this.r)}, ${se(this.g)}, ${se(this.b)}${1===t?\")\":`, ${t})`}`}function le(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function se(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ce(t){return((t=se(t))<16?\"0\":\"\")+t.toString(16)}function ue(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new pe(t,e,n,r)}function de(t){if(t instanceof pe)return new pe(t.h,t.s,t.l,t.opacity);if(t instanceof Ft||(t=te(t)),!t)return new pe;if(t instanceof pe)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,o=Math.min(e,n,r),i=Math.max(e,n,r),a=NaN,l=i-o,s=(i+o)/2;return l?(a=e===i?(n-r)/l+6*(n<r):n===i?(r-e)/l+2:(e-n)/l+4,l/=s<.5?i+o:2-i-o,a*=60):l=s>0&&s<1?0:a,new pe(a,l,s,t.opacity)}function pe(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function fe(t){return(t=(t||0)%360)<0?t+360:t}function me(t){return Math.max(0,Math.min(1,t||0))}function ge(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}It(Ft,te,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Zt,formatHex:Zt,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return de(this).formatHsl()},formatRgb:Qt,toString:Qt}),It(oe,re,zt(Ft,{brighter(t){return t=null==t?Ut:Math.pow(Ut,t),new oe(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Pt:Math.pow(Pt,t),new oe(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new oe(se(this.r),se(this.g),se(this.b),le(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ie,formatHex:ie,formatHex8:function(){return`#${ce(this.r)}${ce(this.g)}${ce(this.b)}${ce(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:ae,toString:ae})),It(pe,(function(t,e,n,r){return 1===arguments.length?de(t):new pe(t,e,n,null==r?1:r)}),zt(Ft,{brighter(t){return t=null==t?Ut:Math.pow(Ut,t),new pe(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Pt:Math.pow(Pt,t),new pe(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,o=2*n-r;return new oe(ge(t>=240?t-240:t+120,o,r),ge(t,o,r),ge(t<120?t+240:t-120,o,r),this.opacity)},clamp(){return new pe(fe(this.h),me(this.s),me(this.l),le(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=le(this.opacity);return`${1===t?\"hsl(\":\"hsla(\"}${fe(this.h)}, ${100*me(this.s)}%, ${100*me(this.l)}%${1===t?\")\":`, ${t})`}`}}));var he=t=>()=>t;function be(t){return 1==(t=+t)?ye:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):he(isNaN(e)?n:e)}}function ye(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):he(isNaN(t)?e:t)}var we=function t(e){var n=be(e);function r(t,e){var r=n((t=re(t)).r,(e=re(e)).r),o=n(t.g,e.g),i=n(t.b,e.b),a=ye(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=o(e),t.b=i(e),t.opacity=a(e),t+\"\"}}return r.gamma=t,r}(1);var xe,ve=(xe=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),o=t[r],i=t[r+1],a=r>0?t[r-1]:2*o-i,l=r<e-1?t[r+2]:2*i-o;return function(t,e,n,r,o){var i=t*t,a=i*t;return((1-3*t+3*i-a)*e+(4-6*i+3*a)*n+(1+3*t+3*i-3*a)*r+a*o)/6}((n-r/e)*e,a,o,i,l)}},function(t){var e,n,r=t.length,o=new Array(r),i=new Array(r),a=new Array(r);for(e=0;e<r;++e)n=re(t[e]),o[e]=n.r||0,i[e]=n.g||0,a[e]=n.b||0;return o=xe(o),i=xe(i),a=xe(a),n.opacity=1,function(t){return n.r=o(t),n.g=i(t),n.b=a(t),n+\"\"}});function ke(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,o=e.slice();return function(i){for(n=0;n<r;++n)o[n]=t[n]*(1-i)+e[n]*i;return o}}function _e(t,e){var n,r=e?e.length:0,o=t?Math.min(r,t.length):0,i=new Array(o),a=new Array(r);for(n=0;n<o;++n)i[n]=Se(t[n],e[n]);for(;n<r;++n)a[n]=e[n];return function(t){for(n=0;n<o;++n)a[n]=i[n](t);return a}}function $e(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function Ee(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Ne(t,e){var n,r={},o={};for(n in null!==t&&\"object\"==typeof t||(t={}),null!==e&&\"object\"==typeof e||(e={}),e)n in t?r[n]=Se(t[n],e[n]):o[n]=e[n];return function(t){for(n in r)o[n]=r[n](t);return o}}var Te=/[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,Me=new RegExp(Te.source,\"g\");function Ae(t,e){var n,r,o,i=Te.lastIndex=Me.lastIndex=0,a=-1,l=[],s=[];for(t+=\"\",e+=\"\";(n=Te.exec(t))&&(r=Me.exec(e));)(o=r.index)>i&&(o=e.slice(i,o),l[a]?l[a]+=o:l[++a]=o),(n=n[0])===(r=r[0])?l[a]?l[a]+=r:l[++a]=r:(l[++a]=null,s.push({i:a,x:Ee(n,r)})),i=Me.lastIndex;return i<e.length&&(o=e.slice(i),l[a]?l[a]+=o:l[++a]=o),l.length<2?s[0]?function(t){return function(e){return t(e)+\"\"}}(s[0].x):function(t){return function(){return t}}(e):(e=s.length,function(t){for(var n,r=0;r<e;++r)l[(n=s[r]).i]=n.x(t);return l.join(\"\")})}function Se(t,e){var n,r,o=typeof e;return null==e||\"boolean\"===o?he(e):(\"number\"===o?Ee:\"string\"===o?(n=te(e))?(e=n,we):Ae:e instanceof te?we:e instanceof Date?$e:(r=e,!ArrayBuffer.isView(r)||r instanceof DataView?Array.isArray(e)?_e:\"function\"!=typeof e.valueOf&&\"function\"!=typeof e.toString||isNaN(e)?Ne:Ee:ke))(t,e)}function Ce(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var Re=t=>ve(t[t.length-1]),De=Re(new Array(3).concat(\"deebf79ecae13182bd\",\"eff3ffbdd7e76baed62171b5\",\"eff3ffbdd7e76baed63182bd08519c\",\"eff3ffc6dbef9ecae16baed63182bd08519c\",\"eff3ffc6dbef9ecae16baed64292c62171b5084594\",\"f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594\",\"f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b\").map(Ot)),Le=Re(new Array(3).concat(\"e5f5e0a1d99b31a354\",\"edf8e9bae4b374c476238b45\",\"edf8e9bae4b374c47631a354006d2c\",\"edf8e9c7e9c0a1d99b74c47631a354006d2c\",\"edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32\",\"f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32\",\"f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b\").map(Ot));function Oe(t,e,n){const r=t.slice();return r[40]=e[n],r[42]=n,r}function Ie(t,e,n){const r=t.slice();return r[43]=e[n],r}function ze(t,e,n){const r=t.slice();return r[46]=e[n],r[42]=n,r}function Fe(e){let n;return{c(){n=h(\"div\"),n.textContent=\"Missing tokens will show on completion.\",k(n,\"class\",\"text-sm border-b text-red-700\")},m(t,e){f(t,n,e)},p:t,i:t,o:t,d(t){t&&m(n)}}}function Pe(t){let e,n,r,o,i,a,l,s,c,u;o=new St({props:{token:t[13],index:-1,underlineStyle:t[8](t[13]),bgStyle:t[9](t[13])}});let d=\"None\"!==t[2]&&Ue(t),g=\"None\"!==t[3]&&He(t),b=void 0!==t[13].top_k&&je(t);return{c(){e=h(\"div\"),n=h(\"div\"),r=h(\"div\"),Z(o.$$.fragment),i=w(),a=h(\"table\"),l=h(\"tbody\"),d&&d.c(),s=w(),g&&g.c(),c=w(),b&&b.c(),k(r,\"class\",\"mb-5 mt-1\"),k(l,\"class\",\"text-xs tracking-wider\"),k(a,\"class\",\"w-full\"),k(n,\"class\",\"text-2xl px-1 pb-1 text-left w-full bg-white\"),k(e,\"class\",\"col-1 flex flex-col items-center\")},m(t,m){f(t,e,m),p(e,n),p(n,r),Q(o,r,null),p(n,i),p(n,a),p(a,l),d&&d.m(l,null),p(l,s),g&&g.m(l,null),p(e,c),b&&b.m(e,null),u=!0},p(t,n){const r={};8192&n[0]&&(r.token=t[13]),8448&n[0]&&(r.underlineStyle=t[8](t[13])),8704&n[0]&&(r.bgStyle=t[9](t[13])),o.$set(r),\"None\"!==t[2]?d?d.p(t,n):(d=Ue(t),d.c(),d.m(l,s)):d&&(d.d(1),d=null),\"None\"!==t[3]?g?g.p(t,n):(g=He(t),g.c(),g.m(l,null)):g&&(g.d(1),g=null),void 0!==t[13].top_k?b?b.p(t,n):(b=je(t),b.c(),b.m(e,null)):b&&(b.d(1),b=null)},i(t){u||(X(o.$$.fragment,t),u=!0)},o(t){J(o.$$.fragment,t),u=!1},d(t){t&&m(e),tt(o),d&&d.d(),g&&g.d(),b&&b.d()}}}function Ue(t){let e,n,r,o,i,a,l,s,c,u=t[14](t[13],t[2])+\"\";return{c(){e=h(\"tr\"),n=h(\"td\"),r=h(\"span\"),o=y(t[2]),a=w(),l=h(\"td\"),s=h(\"span\"),c=y(u),k(r,\"style\",i=t[9](t[13])),k(s,\"class\",\"pl-1\"),k(l,\"class\",\"text-right\")},m(t,i){f(t,e,i),p(e,n),p(n,r),p(r,o),p(e,a),p(e,l),p(l,s),p(s,c)},p(t,e){4&e[0]&&_(o,t[2]),8704&e[0]&&i!==(i=t[9](t[13]))&&k(r,\"style\",i),8196&e[0]&&u!==(u=t[14](t[13],t[2])+\"\")&&_(c,u)},d(t){t&&m(e)}}}function He(t){let e,n,r,o,i,a,l,s,c,u=t[14](t[13],t[3])+\"\";return{c(){e=h(\"tr\"),n=h(\"td\"),r=h(\"span\"),o=y(t[3]),a=w(),l=h(\"td\"),s=h(\"span\"),c=y(u),k(r,\"class\",\"border-b-2\"),k(r,\"style\",i=t[8](t[13])),k(l,\"class\",\"text-right\")},m(t,i){f(t,e,i),p(e,n),p(n,r),p(r,o),p(e,a),p(e,l),p(l,s),p(s,c)},p(t,e){8&e[0]&&_(o,t[3]),8448&e[0]&&i!==(i=t[8](t[13]))&&k(r,\"style\",i),8200&e[0]&&u!==(u=t[14](t[13],t[3])+\"\")&&_(c,u)},d(t){t&&m(e)}}}function je(t){let e,n,r,o,i,a,l=K(t[13].top_k),s=[];for(let e=0;e<l.length;e+=1)s[e]=qe(ze(t,l,e));return{c(){e=h(\"hr\"),n=w(),r=h(\"table\"),o=h(\"thead\"),o.innerHTML='<tr><th class=\"px-1 pb-1 font-normal text-xs text-left text-gray-700 tracking-wide\">Candidate</th> <th class=\"px-1 pb-1 font-normal text-xs text-right text-gray-700 tracking-wide\">Prob</th></tr>',i=w(),a=h(\"tbody\");for(let t=0;t<s.length;t+=1)s[t].c();k(e,\"class\",\"bg-gray-400 w-full my-2\"),k(r,\"class\",\"w-full\")},m(t,l){f(t,e,l),f(t,n,l),f(t,r,l),p(r,o),p(r,i),p(r,a);for(let t=0;t<s.length;t+=1)s[t]&&s[t].m(a,null)},p(t,e){if(1056768&e[0]){let n;for(l=K(t[13].top_k),n=0;n<l.length;n+=1){const r=ze(t,l,n);s[n]?s[n].p(r,e):(s[n]=qe(r),s[n].c(),s[n].m(a,null))}for(;n<s.length;n+=1)s[n].d(1);s.length=l.length}},d(t){t&&(m(e),m(n),m(r)),g(s,t)}}}function qe(t){let e,n,r,o,i,a,l,s,c,u=t[20](t[46].text)+\"\",d=t[46].prob.toFixed(3)+\"\";return{c(){e=h(\"tr\"),n=h(\"td\"),r=h(\"span\"),i=w(),a=h(\"td\"),l=y(d),c=w(),k(r,\"class\",\"bg-gray-200\"),k(n,\"class\",o=\"px-1 text-left font-mono text-sm decoration-2 \"+(t[46].is_masked?\"line-through\":\"\")),k(a,\"class\",s=\"px-1 text-right font-mono text-sm decoration-2 \"+(t[46].is_masked?\"line-through\":\"\")),k(e,\"class\",\"\"+(5===t[42]?\"border-t border-dashed border-gray-300\":\"\"))},m(t,o){f(t,e,o),p(e,n),p(n,r),r.innerHTML=u,p(e,i),p(e,a),p(a,l),p(e,c)},p(t,e){8192&e[0]&&u!==(u=t[20](t[46].text)+\"\")&&(r.innerHTML=u),8192&e[0]&&o!==(o=\"px-1 text-left font-mono text-sm decoration-2 \"+(t[46].is_masked?\"line-through\":\"\"))&&k(n,\"class\",o),8192&e[0]&&d!==(d=t[46].prob.toFixed(3)+\"\")&&_(l,d),8192&e[0]&&s!==(s=\"px-1 text-right font-mono text-sm decoration-2 \"+(t[46].is_masked?\"line-through\":\"\"))&&k(a,\"class\",s)},d(t){t&&m(e)}}}function Be(e){let n,r,o,i;return n=new St({props:{token:e[21],index:-1}}),{c(){Z(n.$$.fragment),r=w(),o=h(\"div\"),k(o,\"class\",\"basis-full h-2\")},m(t,e){Q(n,t,e),f(t,r,e),f(t,o,e),i=!0},p:t,i(t){i||(X(n.$$.fragment,t),i=!0)},o(t){J(n.$$.fragment,t),i=!1},d(t){t&&(m(r),m(o)),tt(n,t)}}}function We(t){let e;let n=function(t){return 0===t[42]?Ye:Ge}(t),r=n(t);return{c(){r.c(),e=x()},m(t,n){r.m(t,n),f(t,e,n)},d(t){t&&m(e),r.d(t)}}}function Ge(t){let e,n,r=K({length:2}),o=[];for(let e=0;e<r.length;e+=1)o[e]=Ve(Ie(t,r,e));return{c(){for(let t=0;t<o.length;t+=1)o[t].c();e=w(),n=h(\"div\"),k(n,\"class\",\"basis-full h-0\")},m(t,r){for(let e=0;e<o.length;e+=1)o[e]&&o[e].m(t,r);f(t,e,r),f(t,n,r)},d(t){t&&(m(e),m(n)),g(o,t)}}}function Ye(t){let e;return{c(){e=h(\"div\"),k(e,\"class\",\"basis-full h-2\")},m(t,n){f(t,e,n)},d(t){t&&m(e)}}}function Ve(e){let n,r,o;return{c(){n=h(\"div\"),r=w(),o=h(\"span\"),o.textContent=\" \",k(n,\"class\",\"basis-full h-0\"),k(o,\"class\",\"inline-block\")},m(t,e){f(t,n,e),f(t,r,e),f(t,o,e)},p:t,d(t){t&&(m(n),m(r),m(o))}}}function Xe(t){let e,n,r,o=!0===t[40].special&&\"\"!==t[40].role&&We(t);return n=new St({props:{token:t[40],index:t[42],underlineStyle:t[8](t[40]),bgStyle:t[9](t[40])}}),{c(){o&&o.c(),e=w(),Z(n.$$.fragment)},m(t,i){o&&o.m(t,i),f(t,e,i),Q(n,t,i),r=!0},p(t,r){!0===t[40].special&&\"\"!==t[40].role?o||(o=We(t),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null);const i={};128&r[0]&&(i.token=t[40]),384&r[0]&&(i.underlineStyle=t[8](t[40])),640&r[0]&&(i.bgStyle=t[9](t[40])),n.$set(i)},i(t){r||(X(n.$$.fragment,t),r=!0)},o(t){J(n.$$.fragment,t),r=!1},d(t){t&&m(e),o&&o.d(t),tt(n,t)}}}function Je(t){let e;return{c(){e=h(\"span\"),e.textContent=\" \",k(e,\"class\",\"inline-block mt-2 border-b-2 border-white bg-gray-700 animate-cpulse\")},m(t,n){f(t,e,n)},d(t){t&&m(e)}}}function Ke(t){let e,n,r;return n=new vt({props:{audioData:t[4].value}}),{c(){e=h(\"div\"),Z(n.$$.fragment),k(e,\"class\",\"my-3\")},m(t,o){f(t,e,o),Q(n,e,null),r=!0},p(t,e){const r={};16&e[0]&&(r.audioData=t[4].value),n.$set(r)},i(t){r||(X(n.$$.fragment,t),r=!0)},o(t){J(n.$$.fragment,t),r=!1},d(t){t&&m(e),tt(n)}}}function Ze(t){let e,n,r,o;return{c(){e=h(\"div\"),n=h(\"video\"),r=h(\"source\"),l(r.src,o=`data:video/mp4;base64,${t[6].value}`)||k(r,\"src\",o),k(r,\"type\",\"video/mp4\"),n.controls=!0,k(e,\"class\",\"my-3\")},m(t,o){f(t,e,o),p(e,n),p(n,r)},p(t,e){64&e[0]&&!l(r.src,o=`data:video/mp4;base64,${t[6].value}`)&&k(r,\"src\",o)},d(t){t&&m(e)}}}function Qe(t){let e,n,r;return{c(){e=h(\"div\"),n=h(\"img\"),l(n.src,r=`data:image/png;base64,${t[5].value}`)||k(n,\"src\",r),k(n,\"alt\",\"Image output\"),k(e,\"class\",\"my-3\")},m(t,r){f(t,e,r),p(e,n)},p(t,e){32&e[0]&&!l(n.src,r=`data:image/png;base64,${t[5].value}`)&&k(n,\"src\",r)},d(t){t&&m(e)}}}function tn(t){let e,n,o,i,a,l,s,c,d,b,y,x,_,$,N,T;const M=[Pe,Fe],A=[];function S(t,e){return t[13]?0:1}o=S(t),i=A[o]=M[o](t);let C=t[1]&&Be(t),R=K(t[7]),D=[];for(let e=0;e<R.length;e+=1)D[e]=Xe(Oe(t,R,e));const L=t=>J(D[t],1,1,(()=>{D[t]=null}));let O=!1===t[0]&&Je(),I=null!==t[4]&&Ke(t),z=null!==t[6]&&Ze(t),F=null!==t[5]&&Qe(t);return{c(){e=h(\"div\"),n=h(\"div\"),i.c(),a=w(),l=h(\"div\"),s=h(\"div\"),c=h(\"span\"),C&&C.c(),d=w();for(let t=0;t<D.length;t+=1)D[t].c();b=w(),O&&O.c(),y=w(),I&&I.c(),x=w(),z&&z.c(),_=w(),F&&F.c(),k(e,\"class\",\"px-1 pt-1 pb-3 absolute opacity-95 bg-white shadow border border-gray-300 pointer-events-none z-50\"),E(e,\"top\",t[12]+\"px\"),E(e,\"left\",t[11]+\"px\"),E(e,\"display\",\"none\"),k(c,\"class\",\"flex flex-wrap text-sm\"),k(c,\"role\",\"main\"),k(s,\"class\",\"px-4\"),k(l,\"class\",\"pt-6 pb-6 flex text-gray-800 font-token\")},m(r,i){f(r,e,i),p(e,n),A[o].m(n,null),t[30](e),f(r,a,i),f(r,l,i),p(l,s),p(s,c),C&&C.m(c,null),p(c,d);for(let t=0;t<D.length;t+=1)D[t]&&D[t].m(c,null);p(c,b),O&&O.m(c,null),p(s,y),I&&I.m(s,null),p(s,x),z&&z.m(s,null),p(s,_),F&&F.m(s,null),$=!0,N||(T=[u(Ct.call(null,c,en)),v(c,\"longmouseover\",t[15]),v(c,\"longmouseout\",t[17]),v(c,\"mouseover\",t[16]),v(c,\"mouseout\",t[18]),v(c,\"focus\",t[19]),v(c,\"blur\",t[19])],N=!0)},p(t,r){let a=o;if(o=S(t),o===a?A[o].p(t,r):(Y(),J(A[a],1,1,(()=>{A[a]=null})),V(),i=A[o],i?i.p(t,r):(i=A[o]=M[o](t),i.c()),X(i,1),i.m(n,null)),(!$||4096&r[0])&&E(e,\"top\",t[12]+\"px\"),(!$||2048&r[0])&&E(e,\"left\",t[11]+\"px\"),t[1]?C?(C.p(t,r),2&r[0]&&X(C,1)):(C=Be(t),C.c(),X(C,1),C.m(c,d)):C&&(Y(),J(C,1,1,(()=>{C=null})),V()),896&r[0]){let e;for(R=K(t[7]),e=0;e<R.length;e+=1){const n=Oe(t,R,e);D[e]?(D[e].p(n,r),X(D[e],1)):(D[e]=Xe(n),D[e].c(),X(D[e],1),D[e].m(c,b))}for(Y(),e=R.length;e<D.length;e+=1)L(e);V()}!1===t[0]?O||(O=Je(),O.c(),O.m(c,null)):O&&(O.d(1),O=null),null!==t[4]?I?(I.p(t,r),16&r[0]&&X(I,1)):(I=Ke(t),I.c(),X(I,1),I.m(s,x)):I&&(Y(),J(I,1,1,(()=>{I=null})),V()),null!==t[6]?z?z.p(t,r):(z=Ze(t),z.c(),z.m(s,_)):z&&(z.d(1),z=null),null!==t[5]?F?F.p(t,r):(F=Qe(t),F.c(),F.m(s,null)):F&&(F.d(1),F=null)},i(t){if(!$){X(i),X(C);for(let t=0;t<R.length;t+=1)X(D[t]);X(I),$=!0}},o(t){J(i),J(C),D=D.filter(Boolean);for(let t=0;t<D.length;t+=1)J(D[t]);J(I),$=!1},d(n){n&&(m(e),m(a),m(l)),A[o].d(),t[30](null),C&&C.d(),g(D,n),O&&O.d(),I&&I.d(),z&&z.d(),F&&F.d(),N=!1,r(T)}}}const en=200;function nn(t,e,n){let{textComponents:r}=e,{tokenDetails:o}=e,{isCompleted:i}=e,{isError:a}=e,{requireFullReplay:l=!1}=e,{bgField:s=\"Token\"}=e,{underlineField:c=\"Probability\"}=e,u=t=>\"\",d=t=>\"\";const p=t=>{const e=(t=>{const e=t.match(/rgba?\\(\\s*(\\d+),\\s*(\\d+),\\s*(\\d+)/);return e?.299*parseInt(e[1],10)+.587*parseInt(e[2],10)+.114*parseInt(e[3],10):(console.error(\"Invalid RGBA format.\"),0)})(t);return e>186?\"rgba(0, 0, 0, 1)\":\"rgba(255, 255, 255, 1)\"},f=(t,e)=>{if(void 0===t)return\"\";let n=De(t);return`background-color: ${n}; color: ${p(n)};`},m=(t,e)=>{if(void 0===t)return\"\";return`border-bottom-color: ${Le(.7*t)};`},g=t=>{let e=\"\";return t.is_input?e=\"rgba(255, 255, 255, 0)\":t.is_force_forwarded?e=\"rgba(243, 244, 246, 1)\":t.is_generated?e=\"rgba(229, 231, 235, 1)\":(console.log(`ERROR: token ${t.text} does not have emit flags.`),e=\"rgba(255, 255, 255, 0)\"),`background-color: ${e};`},h=(t,e,n,r)=>{let o=!1,i=!1;return t<=n&&e-1>=n?o=!0:t<=r-1&&e>=r?(o=!0,i=!0):t>=n&&e<=r&&(o=!0),[o,i]};let b,y,w=null,x=null,v=null,k=[],_=[],$=[],E=new Set,N={},T=0,M={},A=0,S=0;let C=\"\",R=\"\";return t.$$set=t=>{\"textComponents\"in t&&n(22,r=t.textComponents),\"tokenDetails\"in t&&n(23,o=t.tokenDetails),\"isCompleted\"in t&&n(0,i=t.isCompleted),\"isError\"in t&&n(24,a=t.isError),\"requireFullReplay\"in t&&n(1,l=t.requireFullReplay),\"bgField\"in t&&n(2,s=t.bgField),\"underlineField\"in t&&n(3,c=t.underlineField)},t.$$.update=()=>{if(1069547773&t.$$.dirty[0]){for(0===r.length&&(n(7,k=[]),n(25,_=[]),n(26,$=[]),E.clear(),n(27,N={}),n(28,T=0));T<r.length;n(28,T+=1)){const t=r[T];if(lt(t))_.push(t),$.push(t.closer_text||\"\");else if(st(t))if(0===_.length)if(0!==$.length&&$[$.length-1]===t.value){const e={text:t.value,prob:t.prob,latency_ms:0,role:\"\",special:!0,is_input:t.is_input,is_force_forwarded:t.is_force_forwarded,is_generated:t.is_generated};E.add(e.text),k.push(e),$.pop()}else{const e={text:t.value,prob:t.prob,latency_ms:0,role:\"\",special:!1,is_input:t.is_input,is_force_forwarded:t.is_force_forwarded,is_generated:t.is_generated};k.push(e)}else{const e=_[_.length-1];e.text&&e.text!==t.value&&console.log(`Active role text does not match next text output: ${e.text} - ${t.value}`);const r={text:t.value,prob:t.prob,latency_ms:0,role:e.name||\"\",special:!0,is_input:t.is_input,is_force_forwarded:t.is_force_forwarded,is_generated:t.is_generated};\"\"!==r.role&&n(27,N[t.value]=r.role,N),E.add(r.text),k.push(r),_.pop()}else ut(t)?null===w&&n(4,w=t):ct(t)?null===x&&n(5,x=t):dt(t)&&null===v&&n(6,v=t)}0!==_.length||$.length;if(o.length>0){const t=function(t,e){const n=[];for(const r of e){let e=0;for(;-1!==(e=t.indexOf(r,e));)n.push([e,e+r.length,r]),e+=r.length}return n.sort(((t,e)=>t[0]===e[0]?t[1]-e[1]:t[0]-e[0])),n}(o.map((t=>t.text)).join(\"\"),Array.from(E));n(7,k=[]);let e=0,r=0,i=!1;for(const a of o){e=r,r=e+a.text.length;let o=!1,l=\"\";if(t.length>0){let[n,a,s]=t[0];e>=a&&(t.shift(),t.length>0&&([n,a,s]=t[0]));let[c,u]=h(e,r,n,a);if(c){if(Object.keys(N).includes(s)&&(i||(l=N[s],i=!0)),t.length>1){let[n,o,a]=t[1];const[s,c]=h(e,r,n,o);s&&Object.keys(N).includes(a)&&(l=N[a],i=!0,u=!1)}u||(o=!0)}else i=!1}const s={text:a.text,prob:a.prob,latency_ms:a.latency_ms,role:l,special:o,is_input:a.is_input,is_force_forwarded:a.is_force_forwarded,is_generated:a.is_generated,top_k:a.top_k};n(29,M[\"latency.max\"]=Math.max(s.latency_ms,M[\"latency.max\"]||0),M),k.push(s)}}n(8,u=!i||a?t=>\"border: none;\":\"Probability\"===c?t=>m(t.prob):\"Latency (ms)\"===c?t=>m(Math.log(t.latency_ms)/Math.log(M[\"latency.max\"])):t=>\"border: none;\"),!i||a||\"Type\"===s?n(9,d=t=>g(t)):\"Probability\"===s?n(9,d=t=>f(t.prob)):\"Latency (ms)\"===s?(n(9,d=t=>f(Math.log(t.latency_ms)/Math.log(M[\"latency.max\"]))),console.log(M[\"latency.max\"])):n(9,d=t=>\"\"),n(0,i),n(22,r),n(39,E),n(28,T),n(25,_),n(26,$),n(7,k),n(4,w),n(5,x),n(6,v),n(23,o),n(27,N),n(29,M),n(24,a),n(3,c),n(2,s),n(24,a),n(22,r),n(39,E),n(28,T),n(25,_),n(26,$),n(7,k),n(4,w),n(5,x),n(6,v),n(23,o),n(27,N),n(29,M),n(0,i),n(3,c),n(2,s),n(23,o),n(22,r),n(39,E),n(28,T),n(25,_),n(26,$),n(7,k),n(4,w),n(5,x),n(6,v),n(27,N),n(29,M),n(0,i),n(24,a),n(3,c),n(2,s),n(22,r),n(39,E),n(28,T),n(25,_),n(26,$),n(7,k),n(4,w),n(5,x),n(6,v),n(23,o),n(27,N),n(29,M),n(0,i),n(24,a),n(3,c),n(2,s),n(7,k),n(22,r),n(39,E),n(28,T),n(25,_),n(26,$),n(4,w),n(5,x),n(6,v),n(23,o),n(27,N),n(29,M),n(0,i),n(24,a),n(3,c),n(2,s)}},[i,l,s,c,w,x,v,k,u,d,b,A,S,y,(t,e)=>{if(\"Probability\"===e)return t.prob.toFixed(3);if(\"Latency (ms)\"===e)return t.latency_ms.toFixed(0);if(\"Type\"===e){if(t.is_input)return\"Input\";if(t.is_force_forwarded)return\"Forwarded\";if(t.is_generated)return\"Generated\"}else if(\"None\"===e)return\"\"},t=>{const e=t.detail.target;if(e.matches(\".token-grid-item\")){const t=e.dataset.index,r=15,o=10,i=e.getBoundingClientRect();n(11,A=i.left+window.scrollX+i.width/2+r),n(12,S=i.bottom+window.scrollY+o),n(10,b.style.display=\"block\",b);const a=Number(t);n(13,y=k[a]),A+b.offsetWidth>window.innerWidth&&n(11,A=window.innerWidth-b.offsetWidth),S+b.offsetHeight>window.innerHeight&&n(12,S=window.innerHeight-b.offsetHeight)}},t=>{var e;const n=t.target;if(n.matches(\".token-grid-item\")){const t=n.dataset.index,r=null===(e=n.parentElement)||void 0===e?void 0:e.querySelectorAll(`.token-grid-item[data-index=\"${t}\"]`);if(r)for(const t of r){const e=t;C=e.style.color,R=e.style.backgroundColor,e.style.color=\"rgb(249, 250, 251)\",e.style.backgroundColor=\"rgb(75, 85, 99)\"}}},t=>{t.detail.target.matches(\".token-grid-item\")&&n(10,b.style.display=\"none\",b)},t=>{var e;const n=t.target;if(n.matches(\".token-grid-item\")){const t=n.dataset.index,r=null===(e=n.parentElement)||void 0===e?void 0:e.querySelectorAll(`.token-grid-item[data-index=\"${t}\"]`);if(r)for(const t of r){const e=t;e.style.color=C,e.style.backgroundColor=R}}},t=>{},t=>Lt.sanitize(t.replaceAll(\" \",\"&nbsp;\").replaceAll(\"\\t\",\"\\\\t\").replaceAll(\"\\n\",\"\\\\n\")),{text:\"...\",prob:1,latency_ms:0,role:\"\",special:!1,is_input:!0,is_force_forwarded:!1,is_generated:!0},r,o,a,_,$,N,T,M,function(t){O[t?\"unshift\":\"push\"]((()=>{b=t,n(10,b)}))}]}class rn extends rt{constructor(t){super(),nt(this,t,nn,tn,i,{textComponents:22,tokenDetails:23,isCompleted:0,isError:24,requireFullReplay:1,bgField:2,underlineField:3},null,[-1,-1])}}function on(t){let e,n=null;return C((()=>{e=document.querySelector(\"html\"),window.addEventListener(\"load\",(()=>{n=setInterval((()=>{const t=e.getBoundingClientRect().height;if(0!==t&&e.checkVisibility()){const e={type:\"resize\",content:{height:`${t}px`,width:\"100%\"}};mt.set(e)}}),20)}))})),R((()=>{clearInterval(n)})),[]}class an extends rt{constructor(t){super(),nt(this,t,on,null,i,{})}}const{window:ln}=d;function sn(e){let n,r;return{c:t,m(t,o){n||(r=v(ln,\"message\",e[0]),n=!0)},p:t,i:t,o:t,d(t){n=!1,r()}}}function cn(t){let e=null,n=null;return C((()=>{e=mt.subscribe((t=>{void 0!==t&&window.parent.postMessage(t,\"*\")})),n=gt.subscribe((t=>{void 0!==t&&window.parent.postMessage(t,\"*\")}))})),R((()=>{e&&e(),n&&n()})),[t=>{if(t.source===window.parent&&\"type\"in t.data)if(\"kernelmsg\"===t.data.type){let e=t.data;ft.set(e)}else if(\"init_state\"===t.data.type){let e=t.data;gt.set(e)}}]}class un extends rt{constructor(t){super(),nt(this,t,cn,sn,i,{})}}function dn(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function pn(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function fn(t){let e,n,r;function o(t,r,o=0,i=t.length){if(o<i){if(0!==e(r,r))return i;do{const e=o+i>>>1;n(t[e],r)<0?o=e+1:i=e}while(o<i)}return o}return 2!==t.length?(e=dn,n=(e,n)=>dn(t(e),n),r=(e,n)=>t(e)-n):(e=t===dn||t===pn?t:mn,n=t,r=t),{left:o,center:function(t,e,n=0,i=t.length){const a=o(t,e,n,i-1);return a>n&&r(t[a-1],e)>-r(t[a],e)?a-1:a},right:function(t,r,o=0,i=t.length){if(o<i){if(0!==e(r,r))return i;do{const e=o+i>>>1;n(t[e],r)<=0?o=e+1:i=e}while(o<i)}return o}}}function mn(){return 0}const gn=fn(dn).right;fn((function(t){return null===t?NaN:+t})).center;const hn=Math.sqrt(50),bn=Math.sqrt(10),yn=Math.sqrt(2);function wn(t,e,n){const r=(e-t)/Math.max(0,n),o=Math.floor(Math.log10(r)),i=r/Math.pow(10,o),a=i>=hn?10:i>=bn?5:i>=yn?2:1;let l,s,c;return o<0?(c=Math.pow(10,-o)/a,l=Math.round(t*c),s=Math.round(e*c),l/c<t&&++l,s/c>e&&--s,c=-c):(c=Math.pow(10,o)*a,l=Math.round(t/c),s=Math.round(e/c),l*c<t&&++l,s*c>e&&--s),s<l&&.5<=n&&n<2?wn(t,e,2*n):[l,s,c]}function xn(t,e,n){return wn(t=+t,e=+e,n=+n)[2]}function vn(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function kn(t){return+t}var _n=[0,1];function $n(t){return t}function En(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:(n=isNaN(e)?NaN:.5,function(){return n});var n}function Nn(t,e,n){var r=t[0],o=t[1],i=e[0],a=e[1];return o<r?(r=En(o,r),i=n(a,i)):(r=En(r,o),i=n(i,a)),function(t){return i(r(t))}}function Tn(t,e,n){var r=Math.min(t.length,e.length)-1,o=new Array(r),i=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)o[a]=En(t[a],t[a+1]),i[a]=n(e[a],e[a+1]);return function(e){var n=gn(t,e,1,r)-1;return i[n](o[n](e))}}function Mn(){var t,e,n,r,o,i,a=_n,l=_n,s=Se,c=$n;function u(){var t,e,n,s=Math.min(a.length,l.length);return c!==$n&&(t=a[0],e=a[s-1],t>e&&(n=t,t=e,e=n),c=function(n){return Math.max(t,Math.min(e,n))}),r=s>2?Tn:Nn,o=i=null,d}function d(e){return null==e||isNaN(e=+e)?n:(o||(o=r(a.map(t),l,s)))(t(c(e)))}return d.invert=function(n){return c(e((i||(i=r(l,a.map(t),Ee)))(n)))},d.domain=function(t){return arguments.length?(a=Array.from(t,kn),u()):a.slice()},d.range=function(t){return arguments.length?(l=Array.from(t),u()):l.slice()},d.rangeRound=function(t){return l=Array.from(t),s=Ce,u()},d.clamp=function(t){return arguments.length?(c=!!t||$n,u()):c!==$n},d.interpolate=function(t){return arguments.length?(s=t,u()):s},d.unknown=function(t){return arguments.length?(n=t,d):n},function(n,r){return t=n,e=r,u()}}function An(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf(\"e\"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function Sn(t){return(t=An(Math.abs(t)))?t[1]:NaN}var Cn,Rn=/^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;function Dn(t){if(!(e=Rn.exec(t)))throw new Error(\"invalid format: \"+t);var e;return new Ln({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function Ln(t){this.fill=void 0===t.fill?\" \":t.fill+\"\",this.align=void 0===t.align?\">\":t.align+\"\",this.sign=void 0===t.sign?\"-\":t.sign+\"\",this.symbol=void 0===t.symbol?\"\":t.symbol+\"\",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?\"\":t.type+\"\"}function On(t,e){var n=An(t,e);if(!n)return t+\"\";var r=n[0],o=n[1];return o<0?\"0.\"+new Array(-o).join(\"0\")+r:r.length>o+1?r.slice(0,o+1)+\".\"+r.slice(o+1):r+new Array(o-r.length+2).join(\"0\")}Dn.prototype=Ln.prototype,Ln.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?\"0\":\"\")+(void 0===this.width?\"\":Math.max(1,0|this.width))+(this.comma?\",\":\"\")+(void 0===this.precision?\"\":\".\"+Math.max(0,0|this.precision))+(this.trim?\"~\":\"\")+this.type};var In={\"%\":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+\"\",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString(\"en\").replace(/,/g,\"\"):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>On(100*t,e),r:On,s:function(t,e){var n=An(t,e);if(!n)return t+\"\";var r=n[0],o=n[1],i=o-(Cn=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,a=r.length;return i===a?r:i>a?r+new Array(i-a+1).join(\"0\"):i>0?r.slice(0,i)+\".\"+r.slice(i):\"0.\"+new Array(1-i).join(\"0\")+An(t,Math.max(0,e+i-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function zn(t){return t}var Fn,Pn,Un,Hn=Array.prototype.map,jn=[\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"µ\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"];function qn(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?zn:(e=Hn.call(t.grouping,Number),n=t.thousands+\"\",function(t,r){for(var o=t.length,i=[],a=0,l=e[0],s=0;o>0&&l>0&&(s+l+1>r&&(l=Math.max(1,r-s)),i.push(t.substring(o-=l,o+l)),!((s+=l+1)>r));)l=e[a=(a+1)%e.length];return i.reverse().join(n)}),o=void 0===t.currency?\"\":t.currency[0]+\"\",i=void 0===t.currency?\"\":t.currency[1]+\"\",a=void 0===t.decimal?\".\":t.decimal+\"\",l=void 0===t.numerals?zn:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Hn.call(t.numerals,String)),s=void 0===t.percent?\"%\":t.percent+\"\",c=void 0===t.minus?\"−\":t.minus+\"\",u=void 0===t.nan?\"NaN\":t.nan+\"\";function d(t){var e=(t=Dn(t)).fill,n=t.align,d=t.sign,p=t.symbol,f=t.zero,m=t.width,g=t.comma,h=t.precision,b=t.trim,y=t.type;\"n\"===y?(g=!0,y=\"g\"):In[y]||(void 0===h&&(h=12),b=!0,y=\"g\"),(f||\"0\"===e&&\"=\"===n)&&(f=!0,e=\"0\",n=\"=\");var w=\"$\"===p?o:\"#\"===p&&/[boxX]/.test(y)?\"0\"+y.toLowerCase():\"\",x=\"$\"===p?i:/[%p]/.test(y)?s:\"\",v=In[y],k=/[defgprs%]/.test(y);function _(t){var o,i,s,p=w,_=x;if(\"c\"===y)_=v(t)+_,t=\"\";else{var $=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:v(Math.abs(t),h),b&&(t=function(t){t:for(var e,n=t.length,r=1,o=-1;r<n;++r)switch(t[r]){case\".\":o=e=r;break;case\"0\":0===o&&(o=r),e=r;break;default:if(!+t[r])break t;o>0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t}(t)),$&&0==+t&&\"+\"!==d&&($=!1),p=($?\"(\"===d?d:c:\"-\"===d||\"(\"===d?\"\":d)+p,_=(\"s\"===y?jn[8+Cn/3]:\"\")+_+($&&\"(\"===d?\")\":\"\"),k)for(o=-1,i=t.length;++o<i;)if(48>(s=t.charCodeAt(o))||s>57){_=(46===s?a+t.slice(o+1):t.slice(o))+_,t=t.slice(0,o);break}}g&&!f&&(t=r(t,1/0));var E=p.length+t.length+_.length,N=E<m?new Array(m-E+1).join(e):\"\";switch(g&&f&&(t=r(N+t,N.length?m-_.length:1/0),N=\"\"),n){case\"<\":t=p+t+_+N;break;case\"=\":t=p+N+t+_;break;case\"^\":t=N.slice(0,E=N.length>>1)+p+t+_+N.slice(E);break;default:t=N+p+t+_}return l(t)}return h=void 0===h?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,h)):Math.max(0,Math.min(20,h)),_.toString=function(){return t+\"\"},_}return{format:d,formatPrefix:function(t,e){var n=d(((t=Dn(t)).type=\"f\",t)),r=3*Math.max(-8,Math.min(8,Math.floor(Sn(e)/3))),o=Math.pow(10,-r),i=jn[8+r/3];return function(t){return n(o*t)+i}}}}function Bn(t,e,n,r){var o,i=function(t,e,n){n=+n;const r=(e=+e)<(t=+t),o=r?xn(e,t,n):xn(t,e,n);return(r?-1:1)*(o<0?1/-o:o)}(t,e,n);switch((r=Dn(null==r?\",f\":r)).type){case\"s\":var a=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(o=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Sn(e)/3)))-Sn(Math.abs(t)))}(i,a))||(r.precision=o),Un(r,a);case\"\":case\"e\":case\"g\":case\"p\":case\"r\":null!=r.precision||isNaN(o=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Sn(e)-Sn(t))+1}(i,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=o-(\"e\"===r.type));break;case\"f\":case\"%\":null!=r.precision||isNaN(o=function(t){return Math.max(0,-Sn(Math.abs(t)))}(i))||(r.precision=o-2*(\"%\"===r.type))}return Pn(r)}function Wn(t){var e=t.domain;return t.ticks=function(t){var n=e();return function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)==(e=+e))return[t];const r=e<t,[o,i,a]=r?wn(e,t,n):wn(t,e,n);if(!(i>=o))return[];const l=i-o+1,s=new Array(l);if(r)if(a<0)for(let t=0;t<l;++t)s[t]=(i-t)/-a;else for(let t=0;t<l;++t)s[t]=(i-t)*a;else if(a<0)for(let t=0;t<l;++t)s[t]=(o+t)/-a;else for(let t=0;t<l;++t)s[t]=(o+t)*a;return s}(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return Bn(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,o,i=e(),a=0,l=i.length-1,s=i[a],c=i[l],u=10;for(c<s&&(o=s,s=c,c=o,o=a,a=l,l=o);u-- >0;){if((o=xn(s,c,n))===r)return i[a]=s,i[l]=c,e(i);if(o>0)s=Math.floor(s/o)*o,c=Math.ceil(c/o)*o;else{if(!(o<0))break;s=Math.ceil(s*o)/o,c=Math.floor(c*o)/o}r=o}return t},t}function Gn(){var t=Mn()($n,$n);return t.copy=function(){return e=t,Gn().domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown());var e},vn.apply(t,arguments),Wn(t)}function Yn(e){let n,r,o,i,a,l;return{c(){n=h(\"div\"),r=b(\"svg\"),o=b(\"g\"),i=b(\"path\"),k(i,\"d\",a=e[3].map(Vn).join(\" \")),k(i,\"fill\",\"none\"),k(i,\"stroke-width\",\"1.25\"),k(i,\"stroke\",\"#374151\"),k(r,\"class\",e[0]),k(n,\"class\",\"inline-block font-medium text-gray-700\"),U((()=>e[9].call(n)))},m(t,a){f(t,n,a),p(n,r),p(r,o),p(o,i),l=function(t,e){\"static\"===getComputedStyle(t).position&&(t.style.position=\"relative\");const n=h(\"iframe\");n.setAttribute(\"style\",\"display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;\"),n.setAttribute(\"aria-hidden\",\"true\"),n.tabIndex=-1;const r=M();let o;return r?(n.src=\"data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\\/script>\",o=v(window,\"message\",(t=>{t.source===n.contentWindow&&e()}))):(n.src=\"about:blank\",n.onload=()=>{o=v(n.contentWindow,\"resize\",e),e()}),p(t,n),()=>{(r||o&&n.contentWindow)&&o(),m(n)}}(n,e[9].bind(n))},p(t,[e]){8&e&&a!==(a=t[3].map(Vn).join(\" \"))&&k(i,\"d\",a),1&e&&k(r,\"class\",t[0])},i:t,o:t,d(t){t&&m(n),l()}}}Fn=qn({thousands:\",\",grouping:[3],currency:[\"$\",\"\"]}),Pn=Fn.format,Un=Fn.formatPrefix;const Vn=(t,e)=>`${0===e?\"M\":\"L\"} ${t.x} ${t.y}`;function Xn(t,e,n){let r,o,i,a,{values:l}=e,{svgClass:s}=e,{padding:c={left:0,right:0,top:0,bottom:0}}=e,u=0,d=0;return t.$$set=t=>{\"values\"in t&&n(4,l=t.values),\"svgClass\"in t&&n(0,s=t.svgClass),\"padding\"in t&&n(5,c=t.padding)},t.$$.update=()=>{16&t.$$.dirty&&n(8,r=l),292&t.$$.dirty&&n(7,o=Gn().domain([0,r.length-1]).range([c.left,c.left+d-c.right])),34&t.$$.dirty&&n(6,i=Gn().domain([0,1]).range([u-c.bottom,c.top])),448&t.$$.dirty&&n(3,a=r.map(((t,e)=>({x:o(e),y:i(t)}))))},[s,u,d,a,l,c,i,o,r,function(){u=this.clientHeight,d=this.clientWidth,n(1,u),n(2,d)}]}class Jn extends rt{constructor(t){super(),nt(this,t,Xn,Yn,i,{values:4,svgClass:0,padding:5})}}function Kn(e){let n,r,o,i,a=e[0].name+\"\";function l(t,e){return\"number\"==typeof t[1]?tr:Qn}let s=l(e),u=s(e);return{c(){n=h(\"span\"),r=y(a),o=w(),u.c(),i=x(),k(n,\"class\",c(\"text-gray-600 whitespace-nowrap pr-[0.125rem]\")+\" svelte-198q8s6\")},m(t,e){f(t,n,e),p(n,r),f(t,o,e),u.m(t,e),f(t,i,e)},p(t,e){1&e&&a!==(a=t[0].name+\"\")&&_(r,a),s===(s=l(t))&&u?u.p(t,e):(u.d(1),u=s(t),u&&(u.c(),u.m(i.parentNode,i)))},i:t,o:t,d(t){t&&(m(n),m(o),m(i)),u.d(t)}}}function Zn(t){let e,n,r,o,i,a=t[0].name+\"\";return o=new Jn({props:{values:t[1],svgClass:\"w-8 h-4 inline\",padding:t[2]}}),{c(){e=h(\"span\"),n=y(a),r=w(),Z(o.$$.fragment),k(e,\"class\",c(\"text-gray-600 whitespace-nowrap pr-[0.125rem]\")+\" svelte-198q8s6\")},m(t,a){f(t,e,a),p(e,n),f(t,r,a),Q(o,t,a),i=!0},p(t,e){(!i||1&e)&&a!==(a=t[0].name+\"\")&&_(n,a);const r={};2&e&&(r.values=t[1]),o.$set(r)},i(t){i||(X(o.$$.fragment,t),i=!0)},o(t){J(o.$$.fragment,t),i=!1},d(t){t&&(m(e),m(r)),tt(o,t)}}}function Qn(t){let e,n,r,o=\"\"!==t[0].units&&er(t);return{c(){e=h(\"span\"),n=y(t[1]),r=w(),o&&o.c(),k(e,\"class\",c(\"font-medium text-center text-gray-700 \")+\" svelte-198q8s6\")},m(t,i){f(t,e,i),p(e,n),p(e,r),o&&o.m(e,null)},p(t,r){2&r&&_(n,t[1]),\"\"!==t[0].units?o?o.p(t,r):(o=er(t),o.c(),o.m(e,null)):o&&(o.d(1),o=null)},d(t){t&&m(e),o&&o.d()}}}function tr(t){let e,n,r,o=t[1].toFixed(t[0].precision)+\"\",i=\"\"!==t[0].units&&nr(t);return{c(){e=h(\"span\"),n=y(o),r=w(),i&&i.c(),k(e,\"class\",c(\"font-medium text-gray-700 \")+\" svelte-198q8s6\")},m(t,o){f(t,e,o),p(e,n),p(e,r),i&&i.m(e,null)},p(t,r){3&r&&o!==(o=t[1].toFixed(t[0].precision)+\"\")&&_(n,o),\"\"!==t[0].units?i?i.p(t,r):(i=nr(t),i.c(),i.m(e,null)):i&&(i.d(1),i=null)},d(t){t&&m(e),i&&i.d()}}}function er(t){let e,n,r=t[0].units+\"\";return{c(){e=h(\"span\"),n=y(r),k(e,\"class\",\"\")},m(t,r){f(t,e,r),p(e,n)},p(t,e){1&e&&r!==(r=t[0].units+\"\")&&_(n,r)},d(t){t&&m(e)}}}function nr(t){let e,n,r=t[0].units+\"\";return{c(){e=h(\"span\"),n=y(r),k(e,\"class\",\"\")},m(t,r){f(t,e,r),p(e,n)},p(t,e){1&e&&r!==(r=t[0].units+\"\")&&_(n,r)},d(t){t&&m(e)}}}function rr(t){let e,n,r,o,i,a;const l=[Zn,Kn],s=[];function u(t,e){return t[1].constructor===Array?0:1}return r=u(t),o=s[r]=l[r](t),{c(){e=h(\"span\"),n=h(\"span\"),o.c(),k(e,\"class\",c(\"dot-divider flex items-center text-xs whitespace-nowrap px-1\")+\" svelte-198q8s6\"),k(e,\"title\",i=t[0].description)},m(t,o){f(t,e,o),p(e,n),s[r].m(n,null),a=!0},p(t,[c]){let d=r;r=u(t),r===d?s[r].p(t,c):(Y(),J(s[d],1,1,(()=>{s[d]=null})),V(),o=s[r],o?o.p(t,c):(o=s[r]=l[r](t),o.c()),X(o,1),o.m(n,null)),(!a||1&c&&i!==(i=t[0].description))&&k(e,\"title\",i)},i(t){a||(X(o),a=!0)},o(t){J(o),a=!1},d(t){t&&m(e),s[r].d()}}}function or(t,e,n){let{metricDef:r}=e,{value:o}=e;return t.$$set=t=>{\"metricDef\"in t&&n(0,r=t.metricDef),\"value\"in t&&n(1,o=t.value)},[r,o,{left:0,right:0,top:5,bottom:3}]}ot('.dot-divider.svelte-198q8s6:not(:last-child):after{color:#d1d5db;content:\"•\";margin-left:.5rem}');class ir extends rt{constructor(t){super(),nt(this,t,or,rr,i,{metricDef:0,value:1})}}function ar(t){var e=function(e){var n=e.target;t.contains(n)||t.dispatchEvent(new CustomEvent(\"outclick\"))};return document.addEventListener(\"click\",e,!0),{destroy:function(){document.removeEventListener(\"click\",e,!0)}}}function lr(t,e,n){const r=t.slice();return r[10]=e[n],r[12]=n,r}function sr(t){let e,n=K(t[1]),r=[];for(let e=0;e<n.length;e+=1)r[e]=cr(lr(t,n,e));return{c(){e=h(\"ul\");for(let t=0;t<r.length;t+=1)r[t].c();k(e,\"role\",\"listbox\"),k(e,\"class\",\"absolute pt-2 pb-3 z-10 mt-1 bg-white shadow border border-gray-300\")},m(t,n){f(t,e,n);for(let t=0;t<r.length;t+=1)r[t]&&r[t].m(e,null)},p(t,o){if(66&o){let i;for(n=K(t[1]),i=0;i<n.length;i+=1){const a=lr(t,n,i);r[i]?r[i].p(a,o):(r[i]=cr(a),r[i].c(),r[i].m(e,null))}for(;i<r.length;i+=1)r[i].d(1);r.length=n.length}},d(t){t&&m(e),g(r,t)}}}function cr(t){let e,n,o,i,a=t[10]+\"\";function l(...e){return t[8](t[10],...e)}return{c(){e=h(\"li\"),n=y(a),k(e,\"class\",`w-full px-4 py-1 ${0===t[12]?\"mt-1\":\"\"} hover:bg-gray-700 hover:text-white text-nowrap`),k(e,\"role\",\"option\"),k(e,\"aria-selected\",\"false\")},m(t,r){f(t,e,r),p(e,n),o||(i=[v(e,\"click\",l),v(e,\"keypress\",dr)],o=!0)},p(e,r){t=e,2&r&&a!==(a=t[10]+\"\")&&_(n,a)},d(t){t&&m(e),o=!1,r(i)}}}function ur(e){let n,o,i,a,l,s,c,d,g,x,$,E,N=e[3]&&sr(e);return{c(){n=h(\"div\"),o=h(\"button\"),i=h(\"span\"),a=h(\"span\"),l=y(e[2]),s=w(),c=b(\"svg\"),d=b(\"path\"),x=w(),N&&N.c(),k(a,\"class\",\"\"),k(d,\"fill-rule\",\"evenodd\"),k(d,\"d\",\"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z\"),k(d,\"clip-rule\",\"evenodd\"),k(c,\"xmlns\",\"http://www.w3.org/2000/svg\"),k(c,\"viewBox\",\"0 0 16 16\"),k(c,\"fill\",\"currentColor\"),k(c,\"class\",\"size-4\"),k(i,\"class\",g=`mr-4 inline-flex justify-between items-center hover:bg-gray-700 hover:text-white ${e[0]}`),k(n,\"class\",\"relative\")},m(t,r){f(t,n,r),p(n,o),p(o,i),p(i,a),p(a,l),p(i,s),p(i,c),p(c,d),p(n,x),N&&N.m(n,null),$||(E=[u(ar.call(null,o)),v(o,\"click\",e[4]),u(ar.call(null,n)),v(n,\"outclick\",e[5])],$=!0)},p(t,[e]){4&e&&_(l,t[2]),1&e&&g!==(g=`mr-4 inline-flex justify-between items-center hover:bg-gray-700 hover:text-white ${t[0]}`)&&k(i,\"class\",g),t[3]?N?N.p(t,e):(N=sr(t),N.c(),N.m(n,null)):N&&(N.d(1),N=null)},i:t,o:t,d(t){t&&m(n),N&&N.d(),$=!1,r(E)}}}const dr=t=>{};function pr(t,e,n){let{classes:r=\"\"}=e,{values:o=[]}=e,{defaultValue:i=\"\"}=e,a=i,l=!1;const s=D(),c=t=>{n(2,a=t),n(3,l=!1),s(\"select\",a)};return t.$$set=t=>{\"classes\"in t&&n(0,r=t.classes),\"values\"in t&&n(1,o=t.values),\"defaultValue\"in t&&n(7,i=t.defaultValue)},[r,o,a,l,t=>{n(3,l=!l)},t=>{n(3,l=!1)},c,i,(t,e)=>c(t)]}class fr extends rt{constructor(t){super(),nt(this,t,pr,ur,i,{classes:0,values:1,defaultValue:7})}}var mr={status:{name:\"\",units:\"\",description:\"Determines whether engine is running, completed or in error.\",isScalar:!0,precision:0},cpu:{name:\"CPU\",units:\"%\",description:\"Average utilization across CPU cores.\",isScalar:!1,precision:1},gpu:{name:\"GPU\",units:\"%\",description:\"Average utilization across GPUs.\",isScalar:!1,precision:1},ram:{name:\"RAM\",units:\"GB\",description:\"Utilization of RAM.\",isScalar:!0,precision:1},vram:{name:\"VRAM\",units:\"GB\",description:\"Utilization of video RAM.\",isScalar:!0,precision:1},\"wall time\":{name:\"Time\",units:\"s\",description:\"Time taken from initial display to engine completion.\",isScalar:!0,precision:1},\"avg latency\":{name:\"Latency\",units:\"ms\",description:\"Average roundtrip latency per token\",isScalar:!0,precision:0},consumed:{name:\"Used\",units:\"tkn\",description:\"Total tokens consumed by language model.\",isScalar:!0,precision:0},\"token reduction\":{name:\"Reduced\",units:\"%\",description:\"Total tokens consumed by language model divided by total tokens.\",isScalar:!0,precision:0}};function gr(t,e,n){const r=t.slice();return r[8]=e[n],r}function hr(t){let e,n;return e=new ir({props:{value:t[0].metrics[t[8]],metricDef:mr[t[8]]}}),{c(){Z(e.$$.fragment)},m(t,r){Q(e,t,r),n=!0},p(t,n){const r={};1&n&&(r.value=t[0].metrics[t[8]]),1&n&&(r.metricDef=mr[t[8]]),e.$set(r)},i(t){n||(X(e.$$.fragment,t),n=!0)},o(t){J(e.$$.fragment,t),n=!1},d(t){tt(e,t)}}}function br(t){let e,n,r,o,i,a,l,s,c,u,d,b,y,x,v,_,$,E,N,T;r=new un({}),i=new an({}),b=new fr({props:{values:[\"None\",\"Type\",\"Probability\",\"Latency (ms)\"],classes:\"ml-4 pl-1 bg-gray-200\",defaultValue:\"Type\"}}),b.$on(\"select\",t[5]),x=new fr({props:{values:[\"None\",\"Probability\",\"Latency (ms)\"],classes:\"border-b-2 pl-1 border-gray-400\",defaultValue:\"Probability\"}}),x.$on(\"select\",t[6]);let M=K(t[0].shownMetrics),A=[];for(let e=0;e<M.length;e+=1)A[e]=hr(gr(t,M,e));const S=t=>J(A[t],1,1,(()=>{A[t]=null}));return N=new rn({props:{textComponents:t[0].textComponents,tokenDetails:t[0].tokenDetails,isCompleted:[\"Done\",\"Error\"].includes(t[0].status),isError:t[0].status===pt.Error,bgField:t[1],underlineField:t[2],requireFullReplay:t[0].requireFullReplay}}),{c(){e=h(\"meta\"),n=w(),Z(r.$$.fragment),o=w(),Z(i.$$.fragment),a=w(),l=h(\"div\"),s=h(\"nav\"),c=h(\"section\"),u=h(\"div\"),d=h(\"span\"),Z(b.$$.fragment),y=w(),Z(x.$$.fragment),v=w(),_=h(\"span\");for(let t=0;t<A.length;t+=1)A[t].c();$=w(),E=h(\"section\"),Z(N.$$.fragment),document.title=\"graphpaper\",k(e,\"name\",\"description\"),k(e,\"content\",\"graphpaper\"),k(d,\"class\",\"flex mr-2\"),k(_,\"class\",\"flex mr-4 text-gray-300 overflow-x-scroll scrollbar-thin scrollbar-track-gray-100 scrollbar-thumb-gray-200\"),k(u,\"class\",\"text-sm pt-2 pb-2 flex justify-between border-b border-gray-200\"),k(c,\"class\",\"\"),k(s,\"class\",\"sticky top-0 z-50 opacity-90\"),k(E,\"class\",\"w-full\"),k(l,\"class\",\"w-full min-h-72\")},m(t,m){p(document.head,e),f(t,n,m),Q(r,t,m),f(t,o,m),Q(i,t,m),f(t,a,m),f(t,l,m),p(l,s),p(s,c),p(c,u),p(u,d),Q(b,d,null),p(d,y),Q(x,d,null),p(u,v),p(u,_);for(let t=0;t<A.length;t+=1)A[t]&&A[t].m(_,null);p(l,$),p(l,E),Q(N,E,null),T=!0},p(t,[e]){if(1&e){let n;for(M=K(t[0].shownMetrics),n=0;n<M.length;n+=1){const r=gr(t,M,n);A[n]?(A[n].p(r,e),X(A[n],1)):(A[n]=hr(r),A[n].c(),X(A[n],1),A[n].m(_,null))}for(Y(),n=M.length;n<A.length;n+=1)S(n);V()}const n={};1&e&&(n.textComponents=t[0].textComponents),1&e&&(n.tokenDetails=t[0].tokenDetails),1&e&&(n.isCompleted=[\"Done\",\"Error\"].includes(t[0].status)),1&e&&(n.isError=t[0].status===pt.Error),2&e&&(n.bgField=t[1]),4&e&&(n.underlineField=t[2]),1&e&&(n.requireFullReplay=t[0].requireFullReplay),N.$set(n)},i(t){if(!T){X(r.$$.fragment,t),X(i.$$.fragment,t),X(b.$$.fragment,t),X(x.$$.fragment,t);for(let t=0;t<M.length;t+=1)X(A[t]);X(N.$$.fragment,t),T=!0}},o(t){J(r.$$.fragment,t),J(i.$$.fragment,t),J(b.$$.fragment,t),J(x.$$.fragment,t),A=A.filter(Boolean);for(let t=0;t<A.length;t+=1)J(A[t]);J(N.$$.fragment,t),T=!1},d(t){t&&(m(n),m(o),m(a),m(l)),m(e),tt(r,t),tt(i,t),tt(b),tt(x),g(A,t),tt(N)}}}function yr(t,e,n){let r,o;s(t,ft,(t=>n(3,r=t))),s(t,gt,(t=>n(4,o=t)));let i={textComponents:[],tokenDetails:[],status:pt.Running,shownMetrics:[],metrics:{status:pt.Running,\"wall time\":0,consumed:0,\"token reduction\":0,\"avg latency\":0,cpu:[0,0,0,0,0],gpu:[0,0,0,0,0],ram:0,vram:0},requireFullReplay:!1},a=\"Type\",l=\"Probability\";C((()=>{const t={type:\"clientmsg\",content:JSON.stringify({class_name:\"ClientReadyMessage\"})};mt.set(t)}));return t.$$.update=()=>{if(16&t.$$.dirty&&void 0!==o&&\"\"!==o.content&&n(0,i=JSON.parse(o.content)),8&t.$$.dirty&&void 0!==r&&\"\"!==r.content){(t=>{if(null!=(e=t)&&\"TraceMessage\"===e.class_name)st(t.node_attr)||lt(t.node_attr)||function(t){return null!=t&&\"RoleCloserInput\"===t.class_name}(t.node_attr)?i.textComponents.push(t.node_attr):ut(t.node_attr)?(console.log(\"Audio available\"),i.textComponents.push(t.node_attr)):ct(t.node_attr)?(console.log(\"Image available\"),i.textComponents.push(t.node_attr)):dt(t.node_attr)&&(console.log(\"Video available\"),i.textComponents.push(t.node_attr));else if(function(t){return null!=t&&\"ExecutionStartedMessage\"===t.class_name}(t))n(0,i.requireFullReplay=!1,i);else if(function(t){return null!=t&&\"ClientReadyAckMessage\"===t.class_name}(t)){if(i.requireFullReplay){console.log(\"Require full replay and went past completion output message.\");const t={type:\"clientmsg\",content:JSON.stringify({class_name:\"OutputRequestMessage\"})};mt.set(t)}}else if(function(t){return null!=t&&\"ResetDisplayMessage\"===t.class_name}(t))n(0,i.textComponents=[],i),n(0,i.status=i.status!==pt.Error?pt.Running:i.status,i);else if(function(t){return null!=t&&\"MetricMessage\"===t.class_name}(t)){const e=t.name,r=t.value;if(e in i.metrics&&e in mr){let t=i.metrics[e];const o=mr[e];!1===o.isScalar?r.constructor===Array?n(0,i.metrics[e]=r,i):n(0,i.metrics[e]=[...t.slice(1),r],i):!0===o.isScalar?n(0,i.metrics[e]=r,i):console.error(`Cannot handle metric: ${e}: ${r}.`),\"status\"===e&&n(0,i.status=r,i)}}else if(function(t){return null!=t&&\"ExecutionCompletedMessage\"===t.class_name}(t))n(0,i.status=pt.Done,i);else if(function(t){return null!=t&&\"TokensMessage\"===t.class_name}(t)){n(0,i.requireFullReplay=!1,i),n(0,i.status=pt.Done,i),n(0,i.tokenDetails=t.tokens,i);const e={type:\"state\",content:JSON.stringify(i)};gt.set(e)}var e;n(0,i),n(4,o)})(JSON.parse(r.content))}1&t.$$.dirty&&(i.status===pt.Running?n(0,i.shownMetrics=[\"status\",\"wall time\",\"cpu\",\"ram\",\"gpu\",\"vram\"],i):n(0,i.shownMetrics=[\"status\",\"consumed\",\"token reduction\",\"avg latency\",\"wall time\"],i))},[i,a,l,r,o,t=>n(1,a=t.detail),t=>n(2,l=t.detail)]}return new class extends rt{constructor(t){super(),nt(this,t,yr,br,i,{})}}({target:document.body})}();\n</script>\n</body>\n</html>\n"
      }
     },
     "6117177dcc9148aca360cbd9d99a4448": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "7651f89f191b49bcbfb8321d434af64e": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "7ff60f0f9d964f92a0e71735d6cf28d9": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "b9276ac4d04b48efa14a978a3631c03f": {
      "model_module": "@guidance-ai/stitch",
      "model_module_version": "^0.1.4",
      "model_name": "StitchModel",
      "state": {
       "_model_module_version": "^0.1.4",
       "_view_module_version": "^0.1.4",
       "clientmsg": "{\"class_name\":\"ClientReadyMessage\"}",
       "initial_height": "auto",
       "initial_width": "100%",
       "kernelmsg": "{\n  \"message_id\": 56,\n  \"class_name\": \"ExecutionCompletedMessage\",\n  \"last_trace_id\": 31,\n  \"is_err\": false\n}",
       "layout": "IPY_MODEL_7ff60f0f9d964f92a0e71735d6cf28d9",
       "srcdoc": "<!doctype html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n\n    <link rel=\"preconnect\" href=\"https://fonts.googleapis.com\">\n    <link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin>\n    <link href=\"https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap\" rel=\"stylesheet\">\n</head>\n<body>\n<script>\nvar app=function(){\"use strict\";function t(){}function e(t){return t()}function n(){return Object.create(null)}function r(t){t.forEach(e)}function o(t){return\"function\"==typeof t}function i(t,e){return t!=t?e==e:t!==e||t&&\"object\"==typeof t||\"function\"==typeof t}let a;function l(t,e){return t===e||(a||(a=document.createElement(\"a\")),a.href=e,t===a.href)}function s(e,n,r){e.$$.on_destroy.push(function(e,...n){if(null==e){for(const t of n)t(void 0);return t}const r=e.subscribe(...n);return r.unsubscribe?()=>r.unsubscribe():r}(n,r))}function c(t){return null==t?\"\":t}function u(e){return e&&o(e.destroy)?e.destroy:t}const d=\"undefined\"!=typeof window?window:\"undefined\"!=typeof globalThis?globalThis:global;function p(t,e){t.appendChild(e)}function f(t,e,n){t.insertBefore(e,n||null)}function m(t){t.parentNode&&t.parentNode.removeChild(t)}function g(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function h(t){return document.createElement(t)}function b(t){return document.createElementNS(\"http://www.w3.org/2000/svg\",t)}function y(t){return document.createTextNode(t)}function w(){return y(\" \")}function x(){return y(\"\")}function v(t,e,n,r){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}function k(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function _(t,e){e=\"\"+e,t.data!==e&&(t.data=e)}function $(t,e){t.value=null==e?\"\":e}function E(t,e,n,r){null==n?t.style.removeProperty(e):t.style.setProperty(e,n,\"\")}let N,T;function M(){if(void 0===N){N=!1;try{\"undefined\"!=typeof window&&window.parent&&window.parent.document}catch(t){N=!0}}return N}function A(t){T=t}function S(){if(!T)throw new Error(\"Function called outside component initialization\");return T}function C(t){S().$$.on_mount.push(t)}function R(t){S().$$.on_destroy.push(t)}function D(){const t=S();return(e,n,{cancelable:r=!1}={})=>{const o=t.$$.callbacks[e];if(o){const i=function(t,e,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(t,{detail:e,bubbles:n,cancelable:r})}(e,n,{cancelable:r});return o.slice().forEach((e=>{e.call(t,i)})),!i.defaultPrevented}return!0}}const L=[],O=[];let I=[];const z=[],F=Promise.resolve();let P=!1;function U(t){I.push(t)}const H=new Set;let j=0;function q(){if(0!==j)return;const t=T;do{try{for(;j<L.length;){const t=L[j];j++,A(t),B(t.$$)}}catch(t){throw L.length=0,j=0,t}for(A(null),L.length=0,j=0;O.length;)O.pop()();for(let t=0;t<I.length;t+=1){const e=I[t];H.has(e)||(H.add(e),e())}I.length=0}while(L.length);for(;z.length;)z.pop()();P=!1,H.clear(),A(t)}function B(t){if(null!==t.fragment){t.update(),r(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(U)}}const W=new Set;let G;function Y(){G={r:0,c:[],p:G}}function V(){G.r||r(G.c),G=G.p}function X(t,e){t&&t.i&&(W.delete(t),t.i(e))}function J(t,e,n,r){if(t&&t.o){if(W.has(t))return;W.add(t),G.c.push((()=>{W.delete(t),r&&(n&&t.d(1),r())})),t.o(e)}else r&&r()}function K(t){return void 0!==t?.length?t:Array.from(t)}function Z(t){t&&t.c()}function Q(t,n,i){const{fragment:a,after_update:l}=t.$$;a&&a.m(n,i),U((()=>{const n=t.$$.on_mount.map(e).filter(o);t.$$.on_destroy?t.$$.on_destroy.push(...n):r(n),t.$$.on_mount=[]})),l.forEach(U)}function tt(t,e){const n=t.$$;null!==n.fragment&&(!function(t){const e=[],n=[];I.forEach((r=>-1===t.indexOf(r)?e.push(r):n.push(r))),n.forEach((t=>t())),I=e}(n.after_update),r(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function et(t,e){-1===t.$$.dirty[0]&&(L.push(t),P||(P=!0,F.then(q)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function nt(e,o,i,a,l,s,c=null,u=[-1]){const d=T;A(e);const p=e.$$={fragment:null,ctx:[],props:s,update:t,not_equal:l,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(o.context||(d?d.$$.context:[])),callbacks:n(),dirty:u,skip_bound:!1,root:o.target||d.$$.root};c&&c(p.root);let f=!1;if(p.ctx=i?i(e,o.props||{},((t,n,...r)=>{const o=r.length?r[0]:n;return p.ctx&&l(p.ctx[t],p.ctx[t]=o)&&(!p.skip_bound&&p.bound[t]&&p.bound[t](o),f&&et(e,t)),n})):[],p.update(),f=!0,r(p.before_update),p.fragment=!!a&&a(p.ctx),o.target){if(o.hydrate){const t=function(t){return Array.from(t.childNodes)}(o.target);p.fragment&&p.fragment.l(t),t.forEach(m)}else p.fragment&&p.fragment.c();o.intro&&X(e.$$.fragment),Q(e,o.target,o.anchor),q()}A(d)}class rt{$$=void 0;$$set=void 0;$destroy(){tt(this,1),this.$destroy=t}$on(e,n){if(!o(n))return t;const r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(n),()=>{const t=r.indexOf(n);-1!==t&&r.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function ot(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&\"undefined\"!=typeof document){var r=document.head||document.getElementsByTagName(\"head\")[0],o=document.createElement(\"style\");o.type=\"text/css\",\"top\"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}\"undefined\"!=typeof window&&(window.__svelte||(window.__svelte={v:new Set})).v.add(\"4\");ot('/*! tailwindcss v3.4.10 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:\"\"}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*{scrollbar-color:auto;scrollbar-width:auto}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.pointer-events-none{pointer-events:none}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.top-0{top:0}.z-10{z-index:10}.z-50{z-index:50}.my-2{margin-bottom:.5rem;margin-top:.5rem}.my-3{margin-bottom:.75rem;margin-top:.75rem}.-mt-4{margin-top:-1rem}.mb-5{margin-bottom:1.25rem}.ml-4{margin-left:1rem}.mr-2{margin-right:.5rem}.mr-4{margin-right:1rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.size-4{height:1rem;width:1rem}.h-0{height:0}.h-12{height:3rem}.h-2{height:.5rem}.h-4{height:1rem}.h-\\\\[20px\\\\]{height:20px}.h-\\\\[40px\\\\]{height:40px}.h-\\\\[6px\\\\]{height:6px}.h-full{height:100%}.min-h-72{min-height:18rem}.w-8{width:2rem}.w-\\\\[20px\\\\]{width:20px}.w-\\\\[400px\\\\]{width:400px}.w-\\\\[40px\\\\]{width:40px}.w-\\\\[60px\\\\]{width:60px}.w-full{width:100%}.min-w-\\\\[50px\\\\]{min-width:50px}.flex-grow{flex-grow:1}.basis-full{flex-basis:100%}@keyframes cpulse{50%{opacity:0}}.animate-cpulse{animation:cpulse 3.5s cubic-bezier(.4,0,.6,1) infinite}.cursor-pointer{cursor:pointer}.resize{resize:both}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-\\\\[10px\\\\]{gap:10px}.gap-\\\\[5px\\\\]{gap:5px}.overflow-x-scroll{overflow-x:scroll}.whitespace-nowrap{white-space:nowrap}.text-nowrap{text-wrap:nowrap}.rounded-\\\\[10px\\\\]{border-radius:10px}.rounded-\\\\[3px\\\\]{border-radius:3px}.rounded-full{border-radius:9999px}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity))}.border-gray-400{--tw-border-opacity:1;border-color:rgb(156 163 175/var(--tw-border-opacity))}.border-white{--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}.bg-\\\\[\\\\#2979ff\\\\]{--tw-bg-opacity:1;background-color:rgb(41 121 255/var(--tw-bg-opacity))}.bg-\\\\[\\\\#6c7a89\\\\]{--tw-bg-opacity:1;background-color:rgb(108 122 137/var(--tw-bg-opacity))}.bg-\\\\[\\\\#ddd\\\\]{--tw-bg-opacity:1;background-color:rgb(221 221 221/var(--tw-bg-opacity))}.bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.bg-gray-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity))}.bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.fill-white{fill:#fff}.p-\\\\[10px\\\\]{padding:10px}.px-1{padding-left:.25rem;padding-right:.25rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-top:.25rem}.pb-1,.py-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-6{padding-bottom:1.5rem}.pl-1{padding-left:.25rem}.pr-\\\\[0\\\\.125rem\\\\]{padding-right:.125rem}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.pt-6{padding-top:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.font-token{font-family:JetBrains Mono}.text-2xl{font-size:1.5rem;line-height:2rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-normal{font-weight:400}.uppercase{text-transform:uppercase}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.text-\\\\[\\\\#555\\\\]{--tw-text-opacity:1;color:rgb(85 85 85/var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity))}.text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity))}.text-purple-800{--tw-text-opacity:1;color:rgb(107 33 168/var(--tw-text-opacity))}.text-red-700{--tw-text-opacity:1;color:rgb(185 28 28/var(--tw-text-opacity))}.underline{text-decoration-line:underline}.line-through{text-decoration-line:line-through}.decoration-2{text-decoration-thickness:2px}.opacity-90{opacity:.9}.opacity-95{opacity:.95}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.scrollbar-thin::-webkit-scrollbar-track{background-color:var(--scrollbar-track);border-radius:var(--scrollbar-track-radius)}.scrollbar-thin::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb);border-radius:var(--scrollbar-thumb-radius)}.scrollbar-thin::-webkit-scrollbar-corner{background-color:var(--scrollbar-corner);border-radius:var(--scrollbar-corner-radius)}.scrollbar-thin{scrollbar-color:var(--scrollbar-thumb,initial) var(--scrollbar-track,initial);scrollbar-width:thin}.scrollbar-thin::-webkit-scrollbar{display:block;height:8px;width:8px}.scrollbar-track-gray-100{--scrollbar-track:#f3f4f6}.scrollbar-thumb-gray-200{--scrollbar-thumb:#e5e7eb}.hover\\\\:bg-gray-700:hover{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.hover\\\\:text-white:hover{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}');const it=[];function at(e,n=t){let r;const o=new Set;function a(t){if(i(e,t)&&(e=t,r)){const t=!it.length;for(const t of o)t[1](),it.push(t,e);if(t){for(let t=0;t<it.length;t+=2)it[t][0](it[t+1]);it.length=0}}}function l(t){a(t(e))}return{set:a,update:l,subscribe:function(i,s=t){const c=[i,s];return o.add(c),1===o.size&&(r=n(a,l)||t),i(e),()=>{o.delete(c),0===o.size&&r&&(r(),r=null)}}}}function lt(t){return null!=t&&\"RoleOpenerInput\"===t.class_name}function st(t){return null!=t&&\"TextOutput\"===t.class_name}function ct(t){return null!=t&&\"ImageOutput\"===t.class_name}function ut(t){return null!=t&&\"AudioOutput\"===t.class_name}function dt(t){return null!=t&&\"VideoOutput\"===t.class_name}var pt,ft=at(void 0),mt=at(void 0),gt=at(void 0);function ht(t){let e,n;return{c(){e=b(\"svg\"),n=b(\"polygon\"),k(n,\"points\",\"5,3 19,12 5,21\"),k(e,\"class\",\"fill-white w-[20px] h-[20px]\"),k(e,\"viewBox\",\"0 0 24 24\")},m(t,r){f(t,e,r),p(e,n)},d(t){t&&m(e)}}}function bt(t){let e,n,r;return{c(){e=b(\"svg\"),n=b(\"rect\"),r=b(\"rect\"),k(n,\"x\",\"6\"),k(n,\"y\",\"5\"),k(n,\"width\",\"4\"),k(n,\"height\",\"14\"),k(r,\"x\",\"14\"),k(r,\"y\",\"5\"),k(r,\"width\",\"4\"),k(r,\"height\",\"14\"),k(e,\"class\",\"fill-white w-[20px] h-[20px]\"),k(e,\"viewBox\",\"0 0 24 24\")},m(t,o){f(t,e,o),p(e,n),p(e,r)},d(t){t&&m(e)}}}function yt(e){let n,o,i,a,s,c,u,d,g,x,N,T,M,A,S,C,R,D,L,O,I,z,F,P,U,H=wt(e[5])+\"\",j=wt(e[4])+\"\";function q(t,e){return t[2]?bt:ht}let B=q(e),W=B(e);return{c(){n=h(\"div\"),o=h(\"div\"),i=h(\"div\"),W.c(),a=w(),s=h(\"div\"),c=h(\"canvas\"),u=w(),d=h(\"div\"),g=h(\"div\"),x=w(),N=h(\"div\"),T=y(H),M=y(\" / \"),A=y(j),S=w(),C=h(\"div\"),R=b(\"svg\"),D=b(\"path\"),L=w(),O=h(\"input\"),I=w(),z=h(\"audio\"),k(i,\"class\",\"w-[40px] h-[40px] rounded-full bg-[#6c7a89] flex items-center justify-center cursor-pointer\"),k(i,\"role\",\"button\"),k(i,\"tabindex\",\"0\"),k(i,\"aria-label\",\"Toggle playback\"),k(c,\"class\",\"w-full h-12\"),k(g,\"class\",\"h-full bg-[#2979ff] rounded-[3px] absolute\"),E(g,\"width\",e[3]+\"%\"),k(d,\"class\",\"h-[6px] bg-[#ddd] rounded-[3px] cursor-pointer relative\"),k(d,\"role\",\"slider\"),k(d,\"tabindex\",\"0\"),k(d,\"aria-label\",\"Seek\"),k(d,\"aria-valuemin\",\"0\"),k(d,\"aria-valuemax\",\"100\"),k(d,\"aria-valuenow\",e[3]),k(s,\"class\",\"flex flex-col flex-grow gap-1\"),k(N,\"class\",\"text-sm text-[#555] min-w-[50px]\"),k(D,\"d\",\"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.07c1.48-.74 2.5-2.26 2.5-4.04z\"),k(R,\"class\",\"w-[20px] h-[20px]\"),k(R,\"viewBox\",\"0 0 24 24\"),k(O,\"type\",\"range\"),k(O,\"min\",\"0\"),k(O,\"max\",\"1\"),k(O,\"step\",\"0.01\"),k(O,\"class\",\"w-[60px]\"),k(C,\"class\",\"flex items-center gap-[5px]\"),k(o,\"class\",\"flex items-center gap-[10px]\"),l(z.src,F=\"data:audio/wav;base64,\"+e[0])||k(z,\"src\",F),k(z,\"class\",\"hidden\"),k(n,\"class\",\"rounded-[10px] border border-gray-400 bg-white p-[10px] w-[400px]\")},m(t,r){f(t,n,r),p(n,o),p(o,i),W.m(i,null),p(o,a),p(o,s),p(s,c),e[13](c),p(s,u),p(s,d),p(d,g),p(o,x),p(o,N),p(N,T),p(N,M),p(N,A),p(o,S),p(o,C),p(C,R),p(R,D),p(C,L),p(C,O),$(O,e[6]),p(n,I),p(n,z),e[15](z),P||(U=[v(i,\"click\",e[8]),v(i,\"keydown\",e[8]),v(d,\"click\",e[10]),v(d,\"keydown\",e[10]),v(O,\"change\",e[14]),v(O,\"input\",e[14]),v(O,\"input\",e[11]),v(z,\"timeupdate\",e[9]),v(z,\"ended\",e[12])],P=!0)},p(t,[e]){B!==(B=q(t))&&(W.d(1),W=B(t),W&&(W.c(),W.m(i,null))),8&e&&E(g,\"width\",t[3]+\"%\"),8&e&&k(d,\"aria-valuenow\",t[3]),32&e&&H!==(H=wt(t[5])+\"\")&&_(T,H),16&e&&j!==(j=wt(t[4])+\"\")&&_(A,j),64&e&&$(O,t[6]),1&e&&!l(z.src,F=\"data:audio/wav;base64,\"+t[0])&&k(z,\"src\",F)},i:t,o:t,d(t){t&&m(n),W.d(),e[13](null),e[15](null),P=!1,r(U)}}}function wt(t){const e=Math.floor(t/60),n=Math.floor(t%60);return`${e}:${n<10?\"0\":\"\"}${n}`}function xt(t,e,n){let r,o,{audioData:i}=e,a=!1,l=0,s=0,c=0,u=1;async function d(){if(!i||!o)return;const t=new AudioContext,e=function(t){const e=atob(t),n=e.length,r=new Uint8Array(n);for(let t=0;t<n;t++)r[t]=e.charCodeAt(t);return r.buffer}(i);try{const n=(await t.decodeAudioData(e)).getChannelData(0),r=o;r.width=r.clientWidth,r.height=r.clientHeight;const i=r.width,a=r.height,l=i,s=Math.floor(n.length/l),c=new Array(l);for(let t=0;t<l;t++){let e=0;for(let r=0;r<s;r++)e+=Math.abs(n[t*s+r]);c[t]=e/s}const u=Math.max(...c),d=u>0?1/u:1,p=r.getContext(\"2d\");p.clearRect(0,0,i,a),p.fillStyle=\"#2979ff\";for(let t=0;t<l;t++){const e=t,n=c[t]*d*a,r=(a-n)/2;p.fillRect(e,r,1,n)}}catch(t){console.error(\"Error decoding audio for waveform:\",t)}}return C((()=>{d()})),t.$$set=t=>{\"audioData\"in t&&n(0,i=t.audioData)},[i,r,a,l,s,c,u,o,function(){r.paused?(r.play(),n(2,a=!0)):(r.pause(),n(2,a=!1))},function(){r&&(n(3,l=r.currentTime/r.duration*100),n(5,c=r.currentTime),n(4,s=r.duration||0))},function(t){const e=t.currentTarget,o=t.offsetX/e.offsetWidth*r.duration;n(1,r.currentTime=o,r)},function(t){n(6,u=t.target.value),n(1,r.volume=u,r)},function(){n(2,a=!1),n(3,l=0),n(5,c=0)},function(t){O[t?\"unshift\":\"push\"]((()=>{o=t,n(7,o)}))},function(){var t;t=this.value,u=\"\"===t?null:+t,n(6,u)},function(t){O[t?\"unshift\":\"push\"]((()=>{r=t,n(1,r)}))}]}!function(t){t.Running=\"Running\",t.Error=\"Error\",t.Done=\"Done\"}(pt||(pt={}));class vt extends rt{constructor(t){super(),nt(this,t,xt,yt,i,{audioData:0})}}function kt(t,e,n){const r=t.slice();return r[4]=e[n],r[6]=n,r}function _t(t){let e,n,r,o,i,a,l=t[4]+\"\",s=0===t[6]&&function(t){let e,n,r=t[0].role+\"\";return{c(){e=h(\"span\"),n=y(r),k(e,\"class\",\"absolute text-xs uppercase -mt-4 text-purple-800 font-sans\")},m(t,r){f(t,e,r),p(e,n)},p(t,e){1&e&&r!==(r=t[0].role+\"\")&&_(n,r)},d(t){t&&m(e)}}}(t);return{c(){e=h(\"span\"),s&&s.c(),n=w(),r=y(l),o=w(),k(e,\"data-index\",t[1]),k(e,\"role\",\"tooltip\"),k(e,\"class\",i=\"token-grid-item inline-block mt-2 border-b-2 \"+(t[0].special?\"text-gray-300\":\"\")),k(e,\"style\",a=`${t[2]} ${t[3]}`)},m(t,i){f(t,e,i),s&&s.m(e,null),p(e,n),p(e,r),p(e,o)},p(t,n){0===t[6]&&s.p(t,n),1&n&&l!==(l=t[4]+\"\")&&_(r,l),2&n&&k(e,\"data-index\",t[1]),1&n&&i!==(i=\"token-grid-item inline-block mt-2 border-b-2 \"+(t[0].special?\"text-gray-300\":\"\"))&&k(e,\"class\",i),12&n&&a!==(a=`${t[2]} ${t[3]}`)&&k(e,\"style\",a)},d(t){t&&m(e),s&&s.d()}}}function $t(t){let e,n,r,o,i,a=0===t[6]&&function(t){let e,n,r=t[0].role+\"\";return{c(){e=h(\"span\"),n=y(r),k(e,\"class\",\"absolute text-xs uppercase -mt-4 text-purple-800 font-sans\")},m(t,r){f(t,e,r),p(e,n)},p(t,e){1&e&&r!==(r=t[0].role+\"\")&&_(n,r)},d(t){t&&m(e)}}}(t);return{c(){e=h(\"span\"),a&&a.c(),n=y(\"\\n            \\\\n\"),o=w(),i=h(\"div\"),k(e,\"data-index\",t[1]),k(e,\"role\",\"tooltip\"),k(e,\"class\",\"token-grid-item inline-block mt-2 border-b-2 text-gray-300\"),k(e,\"style\",r=`${t[2]} ${t[3]}`),k(i,\"class\",\"basis-full h-full\")},m(t,r){f(t,e,r),a&&a.m(e,null),p(e,n),f(t,o,r),f(t,i,r)},p(t,n){0===t[6]&&a.p(t,n),2&n&&k(e,\"data-index\",t[1]),12&n&&r!==(r=`${t[2]} ${t[3]}`)&&k(e,\"style\",r)},d(t){t&&(m(e),m(o),m(i)),a&&a.d()}}}function Et(t){let e,n,r,o=0===t[6]&&function(t){let e,n,r=t[0].role+\"\";return{c(){e=h(\"span\"),n=y(r),k(e,\"class\",\"absolute text-xs uppercase -mt-4 text-purple-800 font-sans\")},m(t,r){f(t,e,r),p(e,n)},p(t,e){1&e&&r!==(r=t[0].role+\"\")&&_(n,r)},d(t){t&&m(e)}}}(t);return{c(){e=h(\"span\"),o&&o.c(),n=y(\"\\n            \\\\t  \\n        \"),k(e,\"data-index\",t[1]),k(e,\"role\",\"tooltip\"),k(e,\"class\",\"token-grid-item inline-block mt-2 border-b-2 text-gray-300\"),k(e,\"style\",r=`${t[2]} ${t[3]}`)},m(t,r){f(t,e,r),o&&o.m(e,null),p(e,n)},p(t,n){0===t[6]&&o.p(t,n),2&n&&k(e,\"data-index\",t[1]),12&n&&r!==(r=`${t[2]} ${t[3]}`)&&k(e,\"style\",r)},d(t){t&&m(e),o&&o.d()}}}function Nt(t){let e,n,r,o=0===t[6]&&function(t){let e,n,r=t[0].role+\"\";return{c(){e=h(\"span\"),n=y(r),k(e,\"class\",\"absolute text-xs uppercase -mt-4 text-purple-800 font-sans\")},m(t,r){f(t,e,r),p(e,n)},p(t,e){1&e&&r!==(r=t[0].role+\"\")&&_(n,r)},d(t){t&&m(e)}}}(t);return{c(){e=h(\"span\"),o&&o.c(),n=y(\"\\n             \\n        \"),k(e,\"data-index\",t[1]),k(e,\"role\",\"tooltip\"),k(e,\"class\",\"token-grid-item inline-block mt-2 border-b-2 text-gray-300\"),k(e,\"style\",r=`${t[2]} ${t[3]}`)},m(t,r){f(t,e,r),o&&o.m(e,null),p(e,n)},p(t,n){0===t[6]&&o.p(t,n),2&n&&k(e,\"data-index\",t[1]),12&n&&r!==(r=`${t[2]} ${t[3]}`)&&k(e,\"style\",r)},d(t){t&&m(e),o&&o.d()}}}function Tt(t){let e;function n(t,e){return\" \"===t[4]?Nt:\"\\t\"===t[4]?Et:\"\\n\"===t[4]?$t:_t}let r=n(t),o=r(t);return{c(){o.c(),e=x()},m(t,n){o.m(t,n),f(t,e,n)},p(t,i){r===(r=n(t))&&o?o.p(t,i):(o.d(1),o=r(t),o&&(o.c(),o.m(e.parentNode,e)))},d(t){t&&m(e),o.d(t)}}}function Mt(e){let n,r=K(e[0].text),o=[];for(let t=0;t<r.length;t+=1)o[t]=Tt(kt(e,r,t));return{c(){for(let t=0;t<o.length;t+=1)o[t].c();n=x()},m(t,e){for(let n=0;n<o.length;n+=1)o[n]&&o[n].m(t,e);f(t,n,e)},p(t,[e]){if(15&e){let i;for(r=K(t[0].text),i=0;i<r.length;i+=1){const a=kt(t,r,i);o[i]?o[i].p(a,e):(o[i]=Tt(a),o[i].c(),o[i].m(n.parentNode,n))}for(;i<o.length;i+=1)o[i].d(1);o.length=r.length}},i:t,o:t,d(t){t&&m(n),g(o,t)}}}function At(t,e,n){let{token:r}=e,{index:o}=e,{underlineStyle:i=\"\"}=e,{bgStyle:a=\"\"}=e;return t.$$set=t=>{\"token\"in t&&n(0,r=t.token),\"index\"in t&&n(1,o=t.index),\"underlineStyle\"in t&&n(2,i=t.underlineStyle),\"bgStyle\"in t&&n(3,a=t.bgStyle)},[r,o,i,a]}class St extends rt{constructor(t){super(),nt(this,t,At,Mt,i,{token:0,index:1,underlineStyle:2,bgStyle:3})}}function Ct(t,e){var n,r=function(r){n=setTimeout((function(){t.dispatchEvent(new CustomEvent(\"longmouseover\",{detail:r}))}),e)},o=function(e){clearTimeout(n),t.dispatchEvent(new CustomEvent(\"longmouseout\",{detail:e}))};return t.addEventListener(\"mouseover\",r),t.addEventListener(\"mouseout\",o),{update:function(t){e=t},destroy:function(){t.removeEventListener(\"mouseover\",r),t.removeEventListener(\"mouseout\",o)}}}\"undefined\"!=typeof globalThis?globalThis:\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self&&self;function Rt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,\"default\")?t.default:t}var Dt={exports:{}};\n/*! @license DOMPurify 3.1.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.7/LICENSE */Dt.exports=function(){const{entries:t,setPrototypeOf:e,isFrozen:n,getPrototypeOf:r,getOwnPropertyDescriptor:o}=Object;let{freeze:i,seal:a,create:l}=Object,{apply:s,construct:c}=\"undefined\"!=typeof Reflect&&Reflect;i||(i=function(t){return t}),a||(a=function(t){return t}),s||(s=function(t,e,n){return t.apply(e,n)}),c||(c=function(t,e){return new t(...e)});const u=k(Array.prototype.forEach),d=k(Array.prototype.pop),p=k(Array.prototype.push),f=k(String.prototype.toLowerCase),m=k(String.prototype.toString),g=k(String.prototype.match),h=k(String.prototype.replace),b=k(String.prototype.indexOf),y=k(String.prototype.trim),w=k(Object.prototype.hasOwnProperty),x=k(RegExp.prototype.test),v=_(TypeError);function k(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return s(t,e,r)}}function _(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return c(t,n)}}function $(t,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:f;e&&e(t,null);let i=r.length;for(;i--;){let e=r[i];if(\"string\"==typeof e){const t=o(e);t!==e&&(n(r)||(r[i]=t),e=t)}t[e]=!0}return t}function E(t){for(let e=0;e<t.length;e++)w(t,e)||(t[e]=null);return t}function N(e){const n=l(null);for(const[r,o]of t(e))w(e,r)&&(Array.isArray(o)?n[r]=E(o):o&&\"object\"==typeof o&&o.constructor===Object?n[r]=N(o):n[r]=o);return n}function T(t,e){for(;null!==t;){const n=o(t,e);if(n){if(n.get)return k(n.get);if(\"function\"==typeof n.value)return k(n.value)}t=r(t)}function n(){return null}return n}const M=i([\"a\",\"abbr\",\"acronym\",\"address\",\"area\",\"article\",\"aside\",\"audio\",\"b\",\"bdi\",\"bdo\",\"big\",\"blink\",\"blockquote\",\"body\",\"br\",\"button\",\"canvas\",\"caption\",\"center\",\"cite\",\"code\",\"col\",\"colgroup\",\"content\",\"data\",\"datalist\",\"dd\",\"decorator\",\"del\",\"details\",\"dfn\",\"dialog\",\"dir\",\"div\",\"dl\",\"dt\",\"element\",\"em\",\"fieldset\",\"figcaption\",\"figure\",\"font\",\"footer\",\"form\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"head\",\"header\",\"hgroup\",\"hr\",\"html\",\"i\",\"img\",\"input\",\"ins\",\"kbd\",\"label\",\"legend\",\"li\",\"main\",\"map\",\"mark\",\"marquee\",\"menu\",\"menuitem\",\"meter\",\"nav\",\"nobr\",\"ol\",\"optgroup\",\"option\",\"output\",\"p\",\"picture\",\"pre\",\"progress\",\"q\",\"rp\",\"rt\",\"ruby\",\"s\",\"samp\",\"section\",\"select\",\"shadow\",\"small\",\"source\",\"spacer\",\"span\",\"strike\",\"strong\",\"style\",\"sub\",\"summary\",\"sup\",\"table\",\"tbody\",\"td\",\"template\",\"textarea\",\"tfoot\",\"th\",\"thead\",\"time\",\"tr\",\"track\",\"tt\",\"u\",\"ul\",\"var\",\"video\",\"wbr\"]),A=i([\"svg\",\"a\",\"altglyph\",\"altglyphdef\",\"altglyphitem\",\"animatecolor\",\"animatemotion\",\"animatetransform\",\"circle\",\"clippath\",\"defs\",\"desc\",\"ellipse\",\"filter\",\"font\",\"g\",\"glyph\",\"glyphref\",\"hkern\",\"image\",\"line\",\"lineargradient\",\"marker\",\"mask\",\"metadata\",\"mpath\",\"path\",\"pattern\",\"polygon\",\"polyline\",\"radialgradient\",\"rect\",\"stop\",\"style\",\"switch\",\"symbol\",\"text\",\"textpath\",\"title\",\"tref\",\"tspan\",\"view\",\"vkern\"]),S=i([\"feBlend\",\"feColorMatrix\",\"feComponentTransfer\",\"feComposite\",\"feConvolveMatrix\",\"feDiffuseLighting\",\"feDisplacementMap\",\"feDistantLight\",\"feDropShadow\",\"feFlood\",\"feFuncA\",\"feFuncB\",\"feFuncG\",\"feFuncR\",\"feGaussianBlur\",\"feImage\",\"feMerge\",\"feMergeNode\",\"feMorphology\",\"feOffset\",\"fePointLight\",\"feSpecularLighting\",\"feSpotLight\",\"feTile\",\"feTurbulence\"]),C=i([\"animate\",\"color-profile\",\"cursor\",\"discard\",\"font-face\",\"font-face-format\",\"font-face-name\",\"font-face-src\",\"font-face-uri\",\"foreignobject\",\"hatch\",\"hatchpath\",\"mesh\",\"meshgradient\",\"meshpatch\",\"meshrow\",\"missing-glyph\",\"script\",\"set\",\"solidcolor\",\"unknown\",\"use\"]),R=i([\"math\",\"menclose\",\"merror\",\"mfenced\",\"mfrac\",\"mglyph\",\"mi\",\"mlabeledtr\",\"mmultiscripts\",\"mn\",\"mo\",\"mover\",\"mpadded\",\"mphantom\",\"mroot\",\"mrow\",\"ms\",\"mspace\",\"msqrt\",\"mstyle\",\"msub\",\"msup\",\"msubsup\",\"mtable\",\"mtd\",\"mtext\",\"mtr\",\"munder\",\"munderover\",\"mprescripts\"]),D=i([\"maction\",\"maligngroup\",\"malignmark\",\"mlongdiv\",\"mscarries\",\"mscarry\",\"msgroup\",\"mstack\",\"msline\",\"msrow\",\"semantics\",\"annotation\",\"annotation-xml\",\"mprescripts\",\"none\"]),L=i([\"#text\"]),O=i([\"accept\",\"action\",\"align\",\"alt\",\"autocapitalize\",\"autocomplete\",\"autopictureinpicture\",\"autoplay\",\"background\",\"bgcolor\",\"border\",\"capture\",\"cellpadding\",\"cellspacing\",\"checked\",\"cite\",\"class\",\"clear\",\"color\",\"cols\",\"colspan\",\"controls\",\"controlslist\",\"coords\",\"crossorigin\",\"datetime\",\"decoding\",\"default\",\"dir\",\"disabled\",\"disablepictureinpicture\",\"disableremoteplayback\",\"download\",\"draggable\",\"enctype\",\"enterkeyhint\",\"face\",\"for\",\"headers\",\"height\",\"hidden\",\"high\",\"href\",\"hreflang\",\"id\",\"inputmode\",\"integrity\",\"ismap\",\"kind\",\"label\",\"lang\",\"list\",\"loading\",\"loop\",\"low\",\"max\",\"maxlength\",\"media\",\"method\",\"min\",\"minlength\",\"multiple\",\"muted\",\"name\",\"nonce\",\"noshade\",\"novalidate\",\"nowrap\",\"open\",\"optimum\",\"pattern\",\"placeholder\",\"playsinline\",\"popover\",\"popovertarget\",\"popovertargetaction\",\"poster\",\"preload\",\"pubdate\",\"radiogroup\",\"readonly\",\"rel\",\"required\",\"rev\",\"reversed\",\"role\",\"rows\",\"rowspan\",\"spellcheck\",\"scope\",\"selected\",\"shape\",\"size\",\"sizes\",\"span\",\"srclang\",\"start\",\"src\",\"srcset\",\"step\",\"style\",\"summary\",\"tabindex\",\"title\",\"translate\",\"type\",\"usemap\",\"valign\",\"value\",\"width\",\"wrap\",\"xmlns\",\"slot\"]),I=i([\"accent-height\",\"accumulate\",\"additive\",\"alignment-baseline\",\"amplitude\",\"ascent\",\"attributename\",\"attributetype\",\"azimuth\",\"basefrequency\",\"baseline-shift\",\"begin\",\"bias\",\"by\",\"class\",\"clip\",\"clippathunits\",\"clip-path\",\"clip-rule\",\"color\",\"color-interpolation\",\"color-interpolation-filters\",\"color-profile\",\"color-rendering\",\"cx\",\"cy\",\"d\",\"dx\",\"dy\",\"diffuseconstant\",\"direction\",\"display\",\"divisor\",\"dur\",\"edgemode\",\"elevation\",\"end\",\"exponent\",\"fill\",\"fill-opacity\",\"fill-rule\",\"filter\",\"filterunits\",\"flood-color\",\"flood-opacity\",\"font-family\",\"font-size\",\"font-size-adjust\",\"font-stretch\",\"font-style\",\"font-variant\",\"font-weight\",\"fx\",\"fy\",\"g1\",\"g2\",\"glyph-name\",\"glyphref\",\"gradientunits\",\"gradienttransform\",\"height\",\"href\",\"id\",\"image-rendering\",\"in\",\"in2\",\"intercept\",\"k\",\"k1\",\"k2\",\"k3\",\"k4\",\"kerning\",\"keypoints\",\"keysplines\",\"keytimes\",\"lang\",\"lengthadjust\",\"letter-spacing\",\"kernelmatrix\",\"kernelunitlength\",\"lighting-color\",\"local\",\"marker-end\",\"marker-mid\",\"marker-start\",\"markerheight\",\"markerunits\",\"markerwidth\",\"maskcontentunits\",\"maskunits\",\"max\",\"mask\",\"media\",\"method\",\"mode\",\"min\",\"name\",\"numoctaves\",\"offset\",\"operator\",\"opacity\",\"order\",\"orient\",\"orientation\",\"origin\",\"overflow\",\"paint-order\",\"path\",\"pathlength\",\"patterncontentunits\",\"patterntransform\",\"patternunits\",\"points\",\"preservealpha\",\"preserveaspectratio\",\"primitiveunits\",\"r\",\"rx\",\"ry\",\"radius\",\"refx\",\"refy\",\"repeatcount\",\"repeatdur\",\"restart\",\"result\",\"rotate\",\"scale\",\"seed\",\"shape-rendering\",\"slope\",\"specularconstant\",\"specularexponent\",\"spreadmethod\",\"startoffset\",\"stddeviation\",\"stitchtiles\",\"stop-color\",\"stop-opacity\",\"stroke-dasharray\",\"stroke-dashoffset\",\"stroke-linecap\",\"stroke-linejoin\",\"stroke-miterlimit\",\"stroke-opacity\",\"stroke\",\"stroke-width\",\"style\",\"surfacescale\",\"systemlanguage\",\"tabindex\",\"tablevalues\",\"targetx\",\"targety\",\"transform\",\"transform-origin\",\"text-anchor\",\"text-decoration\",\"text-rendering\",\"textlength\",\"type\",\"u1\",\"u2\",\"unicode\",\"values\",\"viewbox\",\"visibility\",\"version\",\"vert-adv-y\",\"vert-origin-x\",\"vert-origin-y\",\"width\",\"word-spacing\",\"wrap\",\"writing-mode\",\"xchannelselector\",\"ychannelselector\",\"x\",\"x1\",\"x2\",\"xmlns\",\"y\",\"y1\",\"y2\",\"z\",\"zoomandpan\"]),z=i([\"accent\",\"accentunder\",\"align\",\"bevelled\",\"close\",\"columnsalign\",\"columnlines\",\"columnspan\",\"denomalign\",\"depth\",\"dir\",\"display\",\"displaystyle\",\"encoding\",\"fence\",\"frame\",\"height\",\"href\",\"id\",\"largeop\",\"length\",\"linethickness\",\"lspace\",\"lquote\",\"mathbackground\",\"mathcolor\",\"mathsize\",\"mathvariant\",\"maxsize\",\"minsize\",\"movablelimits\",\"notation\",\"numalign\",\"open\",\"rowalign\",\"rowlines\",\"rowspacing\",\"rowspan\",\"rspace\",\"rquote\",\"scriptlevel\",\"scriptminsize\",\"scriptsizemultiplier\",\"selection\",\"separator\",\"separators\",\"stretchy\",\"subscriptshift\",\"supscriptshift\",\"symmetric\",\"voffset\",\"width\",\"xmlns\"]),F=i([\"xlink:href\",\"xml:id\",\"xlink:title\",\"xml:space\",\"xmlns:xlink\"]),P=a(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm),U=a(/<%[\\w\\W]*|[\\w\\W]*%>/gm),H=a(/\\${[\\w\\W]*}/gm),j=a(/^data-[\\-\\w.\\u00B7-\\uFFFF]/),q=a(/^aria-[\\-\\w]+$/),B=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i),W=a(/^(?:\\w+script|data):/i),G=a(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g),Y=a(/^html$/i),V=a(/^[a-z][.\\w]*(-[.\\w]+)+$/i);var X=Object.freeze({__proto__:null,MUSTACHE_EXPR:P,ERB_EXPR:U,TMPLIT_EXPR:H,DATA_ATTR:j,ARIA_ATTR:q,IS_ALLOWED_URI:B,IS_SCRIPT_OR_DATA:W,ATTR_WHITESPACE:G,DOCTYPE_NAME:Y,CUSTOM_ELEMENT:V});const J={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},K=function(){return\"undefined\"==typeof window?null:window},Z=function(t,e){if(\"object\"!=typeof t||\"function\"!=typeof t.createPolicy)return null;let n=null;const r=\"data-tt-policy-suffix\";e&&e.hasAttribute(r)&&(n=e.getAttribute(r));const o=\"dompurify\"+(n?\"#\"+n:\"\");try{return t.createPolicy(o,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return console.warn(\"TrustedTypes policy \"+o+\" could not be created.\"),null}};function Q(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:K();const n=t=>Q(t);if(n.version=\"3.1.7\",n.removed=[],!e||!e.document||e.document.nodeType!==J.document)return n.isSupported=!1,n;let{document:r}=e;const o=r,a=o.currentScript,{DocumentFragment:s,HTMLTemplateElement:c,Node:k,Element:_,NodeFilter:E,NamedNodeMap:P=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:U,DOMParser:H,trustedTypes:j}=e,q=_.prototype,W=T(q,\"cloneNode\"),G=T(q,\"remove\"),V=T(q,\"nextSibling\"),tt=T(q,\"childNodes\"),et=T(q,\"parentNode\");if(\"function\"==typeof c){const t=r.createElement(\"template\");t.content&&t.content.ownerDocument&&(r=t.content.ownerDocument)}let nt,rt=\"\";const{implementation:ot,createNodeIterator:it,createDocumentFragment:at,getElementsByTagName:lt}=r,{importNode:st}=o;let ct={};n.isSupported=\"function\"==typeof t&&\"function\"==typeof et&&ot&&void 0!==ot.createHTMLDocument;const{MUSTACHE_EXPR:ut,ERB_EXPR:dt,TMPLIT_EXPR:pt,DATA_ATTR:ft,ARIA_ATTR:mt,IS_SCRIPT_OR_DATA:gt,ATTR_WHITESPACE:ht,CUSTOM_ELEMENT:bt}=X;let{IS_ALLOWED_URI:yt}=X,wt=null;const xt=$({},[...M,...A,...S,...R,...L]);let vt=null;const kt=$({},[...O,...I,...z,...F]);let _t=Object.seal(l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$t=null,Et=null,Nt=!0,Tt=!0,Mt=!1,At=!0,St=!1,Ct=!0,Rt=!1,Dt=!1,Lt=!1,Ot=!1,It=!1,zt=!1,Ft=!0,Pt=!1;const Ut=\"user-content-\";let Ht=!0,jt=!1,qt={},Bt=null;const Wt=$({},[\"annotation-xml\",\"audio\",\"colgroup\",\"desc\",\"foreignobject\",\"head\",\"iframe\",\"math\",\"mi\",\"mn\",\"mo\",\"ms\",\"mtext\",\"noembed\",\"noframes\",\"noscript\",\"plaintext\",\"script\",\"style\",\"svg\",\"template\",\"thead\",\"title\",\"video\",\"xmp\"]);let Gt=null;const Yt=$({},[\"audio\",\"video\",\"img\",\"source\",\"image\",\"track\"]);let Vt=null;const Xt=$({},[\"alt\",\"class\",\"for\",\"id\",\"label\",\"name\",\"pattern\",\"placeholder\",\"role\",\"summary\",\"title\",\"value\",\"style\",\"xmlns\"]),Jt=\"http://www.w3.org/1998/Math/MathML\",Kt=\"http://www.w3.org/2000/svg\",Zt=\"http://www.w3.org/1999/xhtml\";let Qt=Zt,te=!1,ee=null;const ne=$({},[Jt,Kt,Zt],m);let re=null;const oe=[\"application/xhtml+xml\",\"text/html\"],ie=\"text/html\";let ae=null,le=null;const se=r.createElement(\"form\"),ce=function(t){return t instanceof RegExp||t instanceof Function},ue=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!le||le!==t){if(t&&\"object\"==typeof t||(t={}),t=N(t),re=-1===oe.indexOf(t.PARSER_MEDIA_TYPE)?ie:t.PARSER_MEDIA_TYPE,ae=\"application/xhtml+xml\"===re?m:f,wt=w(t,\"ALLOWED_TAGS\")?$({},t.ALLOWED_TAGS,ae):xt,vt=w(t,\"ALLOWED_ATTR\")?$({},t.ALLOWED_ATTR,ae):kt,ee=w(t,\"ALLOWED_NAMESPACES\")?$({},t.ALLOWED_NAMESPACES,m):ne,Vt=w(t,\"ADD_URI_SAFE_ATTR\")?$(N(Xt),t.ADD_URI_SAFE_ATTR,ae):Xt,Gt=w(t,\"ADD_DATA_URI_TAGS\")?$(N(Yt),t.ADD_DATA_URI_TAGS,ae):Yt,Bt=w(t,\"FORBID_CONTENTS\")?$({},t.FORBID_CONTENTS,ae):Wt,$t=w(t,\"FORBID_TAGS\")?$({},t.FORBID_TAGS,ae):{},Et=w(t,\"FORBID_ATTR\")?$({},t.FORBID_ATTR,ae):{},qt=!!w(t,\"USE_PROFILES\")&&t.USE_PROFILES,Nt=!1!==t.ALLOW_ARIA_ATTR,Tt=!1!==t.ALLOW_DATA_ATTR,Mt=t.ALLOW_UNKNOWN_PROTOCOLS||!1,At=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,St=t.SAFE_FOR_TEMPLATES||!1,Ct=!1!==t.SAFE_FOR_XML,Rt=t.WHOLE_DOCUMENT||!1,Ot=t.RETURN_DOM||!1,It=t.RETURN_DOM_FRAGMENT||!1,zt=t.RETURN_TRUSTED_TYPE||!1,Lt=t.FORCE_BODY||!1,Ft=!1!==t.SANITIZE_DOM,Pt=t.SANITIZE_NAMED_PROPS||!1,Ht=!1!==t.KEEP_CONTENT,jt=t.IN_PLACE||!1,yt=t.ALLOWED_URI_REGEXP||B,Qt=t.NAMESPACE||Zt,_t=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&ce(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(_t.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&ce(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(_t.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&\"boolean\"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(_t.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),St&&(Tt=!1),It&&(Ot=!0),qt&&(wt=$({},L),vt=[],!0===qt.html&&($(wt,M),$(vt,O)),!0===qt.svg&&($(wt,A),$(vt,I),$(vt,F)),!0===qt.svgFilters&&($(wt,S),$(vt,I),$(vt,F)),!0===qt.mathMl&&($(wt,R),$(vt,z),$(vt,F))),t.ADD_TAGS&&(wt===xt&&(wt=N(wt)),$(wt,t.ADD_TAGS,ae)),t.ADD_ATTR&&(vt===kt&&(vt=N(vt)),$(vt,t.ADD_ATTR,ae)),t.ADD_URI_SAFE_ATTR&&$(Vt,t.ADD_URI_SAFE_ATTR,ae),t.FORBID_CONTENTS&&(Bt===Wt&&(Bt=N(Bt)),$(Bt,t.FORBID_CONTENTS,ae)),Ht&&(wt[\"#text\"]=!0),Rt&&$(wt,[\"html\",\"head\",\"body\"]),wt.table&&($(wt,[\"tbody\"]),delete $t.tbody),t.TRUSTED_TYPES_POLICY){if(\"function\"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw v('TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.');if(\"function\"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw v('TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.');nt=t.TRUSTED_TYPES_POLICY,rt=nt.createHTML(\"\")}else void 0===nt&&(nt=Z(j,a)),null!==nt&&\"string\"==typeof rt&&(rt=nt.createHTML(\"\"));i&&i(t),le=t}},de=$({},[\"mi\",\"mo\",\"mn\",\"ms\",\"mtext\"]),pe=$({},[\"annotation-xml\"]),fe=$({},[\"title\",\"style\",\"font\",\"a\",\"script\"]),me=$({},[...A,...S,...C]),ge=$({},[...R,...D]),he=function(t){let e=et(t);e&&e.tagName||(e={namespaceURI:Qt,tagName:\"template\"});const n=f(t.tagName),r=f(e.tagName);return!!ee[t.namespaceURI]&&(t.namespaceURI===Kt?e.namespaceURI===Zt?\"svg\"===n:e.namespaceURI===Jt?\"svg\"===n&&(\"annotation-xml\"===r||de[r]):Boolean(me[n]):t.namespaceURI===Jt?e.namespaceURI===Zt?\"math\"===n:e.namespaceURI===Kt?\"math\"===n&&pe[r]:Boolean(ge[n]):t.namespaceURI===Zt?!(e.namespaceURI===Kt&&!pe[r])&&!(e.namespaceURI===Jt&&!de[r])&&!ge[n]&&(fe[n]||!me[n]):!(\"application/xhtml+xml\"!==re||!ee[t.namespaceURI]))},be=function(t){p(n.removed,{element:t});try{et(t).removeChild(t)}catch(e){G(t)}},ye=function(t,e){try{p(n.removed,{attribute:e.getAttributeNode(t),from:e})}catch(t){p(n.removed,{attribute:null,from:e})}if(e.removeAttribute(t),\"is\"===t&&!vt[t])if(Ot||It)try{be(e)}catch(t){}else try{e.setAttribute(t,\"\")}catch(t){}},we=function(t){let e=null,n=null;if(Lt)t=\"<remove></remove>\"+t;else{const e=g(t,/^[\\r\\n\\t ]+/);n=e&&e[0]}\"application/xhtml+xml\"===re&&Qt===Zt&&(t='<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>'+t+\"</body></html>\");const o=nt?nt.createHTML(t):t;if(Qt===Zt)try{e=(new H).parseFromString(o,re)}catch(t){}if(!e||!e.documentElement){e=ot.createDocument(Qt,\"template\",null);try{e.documentElement.innerHTML=te?rt:o}catch(t){}}const i=e.body||e.documentElement;return t&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),Qt===Zt?lt.call(e,Rt?\"html\":\"body\")[0]:Rt?e.documentElement:i},xe=function(t){return it.call(t.ownerDocument||t,t,E.SHOW_ELEMENT|E.SHOW_COMMENT|E.SHOW_TEXT|E.SHOW_PROCESSING_INSTRUCTION|E.SHOW_CDATA_SECTION,null)},ve=function(t){return t instanceof U&&(\"string\"!=typeof t.nodeName||\"string\"!=typeof t.textContent||\"function\"!=typeof t.removeChild||!(t.attributes instanceof P)||\"function\"!=typeof t.removeAttribute||\"function\"!=typeof t.setAttribute||\"string\"!=typeof t.namespaceURI||\"function\"!=typeof t.insertBefore||\"function\"!=typeof t.hasChildNodes)},ke=function(t){return\"function\"==typeof k&&t instanceof k},_e=function(t,e,r){ct[t]&&u(ct[t],(t=>{t.call(n,e,r,le)}))},$e=function(t){let e=null;if(_e(\"beforeSanitizeElements\",t,null),ve(t))return be(t),!0;const r=ae(t.nodeName);if(_e(\"uponSanitizeElement\",t,{tagName:r,allowedTags:wt}),t.hasChildNodes()&&!ke(t.firstElementChild)&&x(/<[/\\w]/g,t.innerHTML)&&x(/<[/\\w]/g,t.textContent))return be(t),!0;if(t.nodeType===J.progressingInstruction)return be(t),!0;if(Ct&&t.nodeType===J.comment&&x(/<[/\\w]/g,t.data))return be(t),!0;if(!wt[r]||$t[r]){if(!$t[r]&&Ne(r)){if(_t.tagNameCheck instanceof RegExp&&x(_t.tagNameCheck,r))return!1;if(_t.tagNameCheck instanceof Function&&_t.tagNameCheck(r))return!1}if(Ht&&!Bt[r]){const e=et(t)||t.parentNode,n=tt(t)||t.childNodes;if(n&&e)for(let r=n.length-1;r>=0;--r){const o=W(n[r],!0);o.__removalCount=(t.__removalCount||0)+1,e.insertBefore(o,V(t))}}return be(t),!0}return t instanceof _&&!he(t)?(be(t),!0):\"noscript\"!==r&&\"noembed\"!==r&&\"noframes\"!==r||!x(/<\\/no(script|embed|frames)/i,t.innerHTML)?(St&&t.nodeType===J.text&&(e=t.textContent,u([ut,dt,pt],(t=>{e=h(e,t,\" \")})),t.textContent!==e&&(p(n.removed,{element:t.cloneNode()}),t.textContent=e)),_e(\"afterSanitizeElements\",t,null),!1):(be(t),!0)},Ee=function(t,e,n){if(Ft&&(\"id\"===e||\"name\"===e)&&(n in r||n in se))return!1;if(Tt&&!Et[e]&&x(ft,e));else if(Nt&&x(mt,e));else if(!vt[e]||Et[e]){if(!(Ne(t)&&(_t.tagNameCheck instanceof RegExp&&x(_t.tagNameCheck,t)||_t.tagNameCheck instanceof Function&&_t.tagNameCheck(t))&&(_t.attributeNameCheck instanceof RegExp&&x(_t.attributeNameCheck,e)||_t.attributeNameCheck instanceof Function&&_t.attributeNameCheck(e))||\"is\"===e&&_t.allowCustomizedBuiltInElements&&(_t.tagNameCheck instanceof RegExp&&x(_t.tagNameCheck,n)||_t.tagNameCheck instanceof Function&&_t.tagNameCheck(n))))return!1}else if(Vt[e]);else if(x(yt,h(n,ht,\"\")));else if(\"src\"!==e&&\"xlink:href\"!==e&&\"href\"!==e||\"script\"===t||0!==b(n,\"data:\")||!Gt[t])if(Mt&&!x(gt,h(n,ht,\"\")));else if(n)return!1;return!0},Ne=function(t){return\"annotation-xml\"!==t&&g(t,bt)},Te=function(t){_e(\"beforeSanitizeAttributes\",t,null);const{attributes:e}=t;if(!e)return;const r={attrName:\"\",attrValue:\"\",keepAttr:!0,allowedAttributes:vt};let o=e.length;for(;o--;){const i=e[o],{name:a,namespaceURI:l,value:s}=i,c=ae(a);let p=\"value\"===a?s:y(s);if(r.attrName=c,r.attrValue=p,r.keepAttr=!0,r.forceKeepAttr=void 0,_e(\"uponSanitizeAttribute\",t,r),p=r.attrValue,r.forceKeepAttr)continue;if(ye(a,t),!r.keepAttr)continue;if(!At&&x(/\\/>/i,p)){ye(a,t);continue}St&&u([ut,dt,pt],(t=>{p=h(p,t,\" \")}));const f=ae(t.nodeName);if(Ee(f,c,p))if(!Pt||\"id\"!==c&&\"name\"!==c||(ye(a,t),p=Ut+p),Ct&&x(/((--!?|])>)|<\\/(style|title)/i,p))ye(a,t);else{if(nt&&\"object\"==typeof j&&\"function\"==typeof j.getAttributeType)if(l);else switch(j.getAttributeType(f,c)){case\"TrustedHTML\":p=nt.createHTML(p);break;case\"TrustedScriptURL\":p=nt.createScriptURL(p)}try{l?t.setAttributeNS(l,a,p):t.setAttribute(a,p),ve(t)?be(t):d(n.removed)}catch(t){}}}_e(\"afterSanitizeAttributes\",t,null)},Me=function t(e){let n=null;const r=xe(e);for(_e(\"beforeSanitizeShadowDOM\",e,null);n=r.nextNode();)_e(\"uponSanitizeShadowNode\",n,null),$e(n)||(n.content instanceof s&&t(n.content),Te(n));_e(\"afterSanitizeShadowDOM\",e,null)};return n.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,a=null,l=null;if(te=!t,te&&(t=\"\\x3c!--\\x3e\"),\"string\"!=typeof t&&!ke(t)){if(\"function\"!=typeof t.toString)throw v(\"toString is not a function\");if(\"string\"!=typeof(t=t.toString()))throw v(\"dirty is not a string, aborting\")}if(!n.isSupported)return t;if(Dt||ue(e),n.removed=[],\"string\"==typeof t&&(jt=!1),jt){if(t.nodeName){const e=ae(t.nodeName);if(!wt[e]||$t[e])throw v(\"root node is forbidden and cannot be sanitized in-place\")}}else if(t instanceof k)r=we(\"\\x3c!----\\x3e\"),i=r.ownerDocument.importNode(t,!0),i.nodeType===J.element&&\"BODY\"===i.nodeName||\"HTML\"===i.nodeName?r=i:r.appendChild(i);else{if(!Ot&&!St&&!Rt&&-1===t.indexOf(\"<\"))return nt&&zt?nt.createHTML(t):t;if(r=we(t),!r)return Ot?null:zt?rt:\"\"}r&&Lt&&be(r.firstChild);const c=xe(jt?t:r);for(;a=c.nextNode();)$e(a)||(a.content instanceof s&&Me(a.content),Te(a));if(jt)return t;if(Ot){if(It)for(l=at.call(r.ownerDocument);r.firstChild;)l.appendChild(r.firstChild);else l=r;return(vt.shadowroot||vt.shadowrootmode)&&(l=st.call(o,l,!0)),l}let d=Rt?r.outerHTML:r.innerHTML;return Rt&&wt[\"!doctype\"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&x(Y,r.ownerDocument.doctype.name)&&(d=\"<!DOCTYPE \"+r.ownerDocument.doctype.name+\">\\n\"+d),St&&u([ut,dt,pt],(t=>{d=h(d,t,\" \")})),nt&&zt?nt.createHTML(d):d},n.setConfig=function(){ue(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Dt=!0},n.clearConfig=function(){le=null,Dt=!1},n.isValidAttribute=function(t,e,n){le||ue({});const r=ae(t),o=ae(e);return Ee(r,o,n)},n.addHook=function(t,e){\"function\"==typeof e&&(ct[t]=ct[t]||[],p(ct[t],e))},n.removeHook=function(t){if(ct[t])return d(ct[t])},n.removeHooks=function(t){ct[t]&&(ct[t]=[])},n.removeAllHooks=function(){ct={}},n}var tt=Q();return tt}();var Lt=Rt(Dt.exports);function Ot(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]=\"#\"+t.slice(6*r,6*++r);return n}function It(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function zt(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Ft(){}var Pt=.7,Ut=1/Pt,Ht=\"\\\\s*([+-]?\\\\d+)\\\\s*\",jt=\"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",qt=\"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",Bt=/^#([0-9a-f]{3,8})$/,Wt=new RegExp(`^rgb\\\\(${Ht},${Ht},${Ht}\\\\)$`),Gt=new RegExp(`^rgb\\\\(${qt},${qt},${qt}\\\\)$`),Yt=new RegExp(`^rgba\\\\(${Ht},${Ht},${Ht},${jt}\\\\)$`),Vt=new RegExp(`^rgba\\\\(${qt},${qt},${qt},${jt}\\\\)$`),Xt=new RegExp(`^hsl\\\\(${jt},${qt},${qt}\\\\)$`),Jt=new RegExp(`^hsla\\\\(${jt},${qt},${qt},${jt}\\\\)$`),Kt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Zt(){return this.rgb().formatHex()}function Qt(){return this.rgb().formatRgb()}function te(t){var e,n;return t=(t+\"\").trim().toLowerCase(),(e=Bt.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?ee(e):3===n?new oe(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?ne(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?ne(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Wt.exec(t))?new oe(e[1],e[2],e[3],1):(e=Gt.exec(t))?new oe(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Yt.exec(t))?ne(e[1],e[2],e[3],e[4]):(e=Vt.exec(t))?ne(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Xt.exec(t))?ue(e[1],e[2]/100,e[3]/100,1):(e=Jt.exec(t))?ue(e[1],e[2]/100,e[3]/100,e[4]):Kt.hasOwnProperty(t)?ee(Kt[t]):\"transparent\"===t?new oe(NaN,NaN,NaN,0):null}function ee(t){return new oe(t>>16&255,t>>8&255,255&t,1)}function ne(t,e,n,r){return r<=0&&(t=e=n=NaN),new oe(t,e,n,r)}function re(t,e,n,r){return 1===arguments.length?((o=t)instanceof Ft||(o=te(o)),o?new oe((o=o.rgb()).r,o.g,o.b,o.opacity):new oe):new oe(t,e,n,null==r?1:r);var o}function oe(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function ie(){return`#${ce(this.r)}${ce(this.g)}${ce(this.b)}`}function ae(){const t=le(this.opacity);return`${1===t?\"rgb(\":\"rgba(\"}${se(this.r)}, ${se(this.g)}, ${se(this.b)}${1===t?\")\":`, ${t})`}`}function le(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function se(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ce(t){return((t=se(t))<16?\"0\":\"\")+t.toString(16)}function ue(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new pe(t,e,n,r)}function de(t){if(t instanceof pe)return new pe(t.h,t.s,t.l,t.opacity);if(t instanceof Ft||(t=te(t)),!t)return new pe;if(t instanceof pe)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,o=Math.min(e,n,r),i=Math.max(e,n,r),a=NaN,l=i-o,s=(i+o)/2;return l?(a=e===i?(n-r)/l+6*(n<r):n===i?(r-e)/l+2:(e-n)/l+4,l/=s<.5?i+o:2-i-o,a*=60):l=s>0&&s<1?0:a,new pe(a,l,s,t.opacity)}function pe(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function fe(t){return(t=(t||0)%360)<0?t+360:t}function me(t){return Math.max(0,Math.min(1,t||0))}function ge(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}It(Ft,te,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Zt,formatHex:Zt,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return de(this).formatHsl()},formatRgb:Qt,toString:Qt}),It(oe,re,zt(Ft,{brighter(t){return t=null==t?Ut:Math.pow(Ut,t),new oe(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Pt:Math.pow(Pt,t),new oe(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new oe(se(this.r),se(this.g),se(this.b),le(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ie,formatHex:ie,formatHex8:function(){return`#${ce(this.r)}${ce(this.g)}${ce(this.b)}${ce(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:ae,toString:ae})),It(pe,(function(t,e,n,r){return 1===arguments.length?de(t):new pe(t,e,n,null==r?1:r)}),zt(Ft,{brighter(t){return t=null==t?Ut:Math.pow(Ut,t),new pe(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Pt:Math.pow(Pt,t),new pe(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,o=2*n-r;return new oe(ge(t>=240?t-240:t+120,o,r),ge(t,o,r),ge(t<120?t+240:t-120,o,r),this.opacity)},clamp(){return new pe(fe(this.h),me(this.s),me(this.l),le(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=le(this.opacity);return`${1===t?\"hsl(\":\"hsla(\"}${fe(this.h)}, ${100*me(this.s)}%, ${100*me(this.l)}%${1===t?\")\":`, ${t})`}`}}));var he=t=>()=>t;function be(t){return 1==(t=+t)?ye:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):he(isNaN(e)?n:e)}}function ye(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):he(isNaN(t)?e:t)}var we=function t(e){var n=be(e);function r(t,e){var r=n((t=re(t)).r,(e=re(e)).r),o=n(t.g,e.g),i=n(t.b,e.b),a=ye(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=o(e),t.b=i(e),t.opacity=a(e),t+\"\"}}return r.gamma=t,r}(1);var xe,ve=(xe=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),o=t[r],i=t[r+1],a=r>0?t[r-1]:2*o-i,l=r<e-1?t[r+2]:2*i-o;return function(t,e,n,r,o){var i=t*t,a=i*t;return((1-3*t+3*i-a)*e+(4-6*i+3*a)*n+(1+3*t+3*i-3*a)*r+a*o)/6}((n-r/e)*e,a,o,i,l)}},function(t){var e,n,r=t.length,o=new Array(r),i=new Array(r),a=new Array(r);for(e=0;e<r;++e)n=re(t[e]),o[e]=n.r||0,i[e]=n.g||0,a[e]=n.b||0;return o=xe(o),i=xe(i),a=xe(a),n.opacity=1,function(t){return n.r=o(t),n.g=i(t),n.b=a(t),n+\"\"}});function ke(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,o=e.slice();return function(i){for(n=0;n<r;++n)o[n]=t[n]*(1-i)+e[n]*i;return o}}function _e(t,e){var n,r=e?e.length:0,o=t?Math.min(r,t.length):0,i=new Array(o),a=new Array(r);for(n=0;n<o;++n)i[n]=Se(t[n],e[n]);for(;n<r;++n)a[n]=e[n];return function(t){for(n=0;n<o;++n)a[n]=i[n](t);return a}}function $e(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function Ee(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Ne(t,e){var n,r={},o={};for(n in null!==t&&\"object\"==typeof t||(t={}),null!==e&&\"object\"==typeof e||(e={}),e)n in t?r[n]=Se(t[n],e[n]):o[n]=e[n];return function(t){for(n in r)o[n]=r[n](t);return o}}var Te=/[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,Me=new RegExp(Te.source,\"g\");function Ae(t,e){var n,r,o,i=Te.lastIndex=Me.lastIndex=0,a=-1,l=[],s=[];for(t+=\"\",e+=\"\";(n=Te.exec(t))&&(r=Me.exec(e));)(o=r.index)>i&&(o=e.slice(i,o),l[a]?l[a]+=o:l[++a]=o),(n=n[0])===(r=r[0])?l[a]?l[a]+=r:l[++a]=r:(l[++a]=null,s.push({i:a,x:Ee(n,r)})),i=Me.lastIndex;return i<e.length&&(o=e.slice(i),l[a]?l[a]+=o:l[++a]=o),l.length<2?s[0]?function(t){return function(e){return t(e)+\"\"}}(s[0].x):function(t){return function(){return t}}(e):(e=s.length,function(t){for(var n,r=0;r<e;++r)l[(n=s[r]).i]=n.x(t);return l.join(\"\")})}function Se(t,e){var n,r,o=typeof e;return null==e||\"boolean\"===o?he(e):(\"number\"===o?Ee:\"string\"===o?(n=te(e))?(e=n,we):Ae:e instanceof te?we:e instanceof Date?$e:(r=e,!ArrayBuffer.isView(r)||r instanceof DataView?Array.isArray(e)?_e:\"function\"!=typeof e.valueOf&&\"function\"!=typeof e.toString||isNaN(e)?Ne:Ee:ke))(t,e)}function Ce(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var Re=t=>ve(t[t.length-1]),De=Re(new Array(3).concat(\"deebf79ecae13182bd\",\"eff3ffbdd7e76baed62171b5\",\"eff3ffbdd7e76baed63182bd08519c\",\"eff3ffc6dbef9ecae16baed63182bd08519c\",\"eff3ffc6dbef9ecae16baed64292c62171b5084594\",\"f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594\",\"f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b\").map(Ot)),Le=Re(new Array(3).concat(\"e5f5e0a1d99b31a354\",\"edf8e9bae4b374c476238b45\",\"edf8e9bae4b374c47631a354006d2c\",\"edf8e9c7e9c0a1d99b74c47631a354006d2c\",\"edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32\",\"f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32\",\"f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b\").map(Ot));function Oe(t,e,n){const r=t.slice();return r[40]=e[n],r[42]=n,r}function Ie(t,e,n){const r=t.slice();return r[43]=e[n],r}function ze(t,e,n){const r=t.slice();return r[46]=e[n],r[42]=n,r}function Fe(e){let n;return{c(){n=h(\"div\"),n.textContent=\"Missing tokens will show on completion.\",k(n,\"class\",\"text-sm border-b text-red-700\")},m(t,e){f(t,n,e)},p:t,i:t,o:t,d(t){t&&m(n)}}}function Pe(t){let e,n,r,o,i,a,l,s,c,u;o=new St({props:{token:t[13],index:-1,underlineStyle:t[8](t[13]),bgStyle:t[9](t[13])}});let d=\"None\"!==t[2]&&Ue(t),g=\"None\"!==t[3]&&He(t),b=void 0!==t[13].top_k&&je(t);return{c(){e=h(\"div\"),n=h(\"div\"),r=h(\"div\"),Z(o.$$.fragment),i=w(),a=h(\"table\"),l=h(\"tbody\"),d&&d.c(),s=w(),g&&g.c(),c=w(),b&&b.c(),k(r,\"class\",\"mb-5 mt-1\"),k(l,\"class\",\"text-xs tracking-wider\"),k(a,\"class\",\"w-full\"),k(n,\"class\",\"text-2xl px-1 pb-1 text-left w-full bg-white\"),k(e,\"class\",\"col-1 flex flex-col items-center\")},m(t,m){f(t,e,m),p(e,n),p(n,r),Q(o,r,null),p(n,i),p(n,a),p(a,l),d&&d.m(l,null),p(l,s),g&&g.m(l,null),p(e,c),b&&b.m(e,null),u=!0},p(t,n){const r={};8192&n[0]&&(r.token=t[13]),8448&n[0]&&(r.underlineStyle=t[8](t[13])),8704&n[0]&&(r.bgStyle=t[9](t[13])),o.$set(r),\"None\"!==t[2]?d?d.p(t,n):(d=Ue(t),d.c(),d.m(l,s)):d&&(d.d(1),d=null),\"None\"!==t[3]?g?g.p(t,n):(g=He(t),g.c(),g.m(l,null)):g&&(g.d(1),g=null),void 0!==t[13].top_k?b?b.p(t,n):(b=je(t),b.c(),b.m(e,null)):b&&(b.d(1),b=null)},i(t){u||(X(o.$$.fragment,t),u=!0)},o(t){J(o.$$.fragment,t),u=!1},d(t){t&&m(e),tt(o),d&&d.d(),g&&g.d(),b&&b.d()}}}function Ue(t){let e,n,r,o,i,a,l,s,c,u=t[14](t[13],t[2])+\"\";return{c(){e=h(\"tr\"),n=h(\"td\"),r=h(\"span\"),o=y(t[2]),a=w(),l=h(\"td\"),s=h(\"span\"),c=y(u),k(r,\"style\",i=t[9](t[13])),k(s,\"class\",\"pl-1\"),k(l,\"class\",\"text-right\")},m(t,i){f(t,e,i),p(e,n),p(n,r),p(r,o),p(e,a),p(e,l),p(l,s),p(s,c)},p(t,e){4&e[0]&&_(o,t[2]),8704&e[0]&&i!==(i=t[9](t[13]))&&k(r,\"style\",i),8196&e[0]&&u!==(u=t[14](t[13],t[2])+\"\")&&_(c,u)},d(t){t&&m(e)}}}function He(t){let e,n,r,o,i,a,l,s,c,u=t[14](t[13],t[3])+\"\";return{c(){e=h(\"tr\"),n=h(\"td\"),r=h(\"span\"),o=y(t[3]),a=w(),l=h(\"td\"),s=h(\"span\"),c=y(u),k(r,\"class\",\"border-b-2\"),k(r,\"style\",i=t[8](t[13])),k(l,\"class\",\"text-right\")},m(t,i){f(t,e,i),p(e,n),p(n,r),p(r,o),p(e,a),p(e,l),p(l,s),p(s,c)},p(t,e){8&e[0]&&_(o,t[3]),8448&e[0]&&i!==(i=t[8](t[13]))&&k(r,\"style\",i),8200&e[0]&&u!==(u=t[14](t[13],t[3])+\"\")&&_(c,u)},d(t){t&&m(e)}}}function je(t){let e,n,r,o,i,a,l=K(t[13].top_k),s=[];for(let e=0;e<l.length;e+=1)s[e]=qe(ze(t,l,e));return{c(){e=h(\"hr\"),n=w(),r=h(\"table\"),o=h(\"thead\"),o.innerHTML='<tr><th class=\"px-1 pb-1 font-normal text-xs text-left text-gray-700 tracking-wide\">Candidate</th> <th class=\"px-1 pb-1 font-normal text-xs text-right text-gray-700 tracking-wide\">Prob</th></tr>',i=w(),a=h(\"tbody\");for(let t=0;t<s.length;t+=1)s[t].c();k(e,\"class\",\"bg-gray-400 w-full my-2\"),k(r,\"class\",\"w-full\")},m(t,l){f(t,e,l),f(t,n,l),f(t,r,l),p(r,o),p(r,i),p(r,a);for(let t=0;t<s.length;t+=1)s[t]&&s[t].m(a,null)},p(t,e){if(1056768&e[0]){let n;for(l=K(t[13].top_k),n=0;n<l.length;n+=1){const r=ze(t,l,n);s[n]?s[n].p(r,e):(s[n]=qe(r),s[n].c(),s[n].m(a,null))}for(;n<s.length;n+=1)s[n].d(1);s.length=l.length}},d(t){t&&(m(e),m(n),m(r)),g(s,t)}}}function qe(t){let e,n,r,o,i,a,l,s,c,u=t[20](t[46].text)+\"\",d=t[46].prob.toFixed(3)+\"\";return{c(){e=h(\"tr\"),n=h(\"td\"),r=h(\"span\"),i=w(),a=h(\"td\"),l=y(d),c=w(),k(r,\"class\",\"bg-gray-200\"),k(n,\"class\",o=\"px-1 text-left font-mono text-sm decoration-2 \"+(t[46].is_masked?\"line-through\":\"\")),k(a,\"class\",s=\"px-1 text-right font-mono text-sm decoration-2 \"+(t[46].is_masked?\"line-through\":\"\")),k(e,\"class\",\"\"+(5===t[42]?\"border-t border-dashed border-gray-300\":\"\"))},m(t,o){f(t,e,o),p(e,n),p(n,r),r.innerHTML=u,p(e,i),p(e,a),p(a,l),p(e,c)},p(t,e){8192&e[0]&&u!==(u=t[20](t[46].text)+\"\")&&(r.innerHTML=u),8192&e[0]&&o!==(o=\"px-1 text-left font-mono text-sm decoration-2 \"+(t[46].is_masked?\"line-through\":\"\"))&&k(n,\"class\",o),8192&e[0]&&d!==(d=t[46].prob.toFixed(3)+\"\")&&_(l,d),8192&e[0]&&s!==(s=\"px-1 text-right font-mono text-sm decoration-2 \"+(t[46].is_masked?\"line-through\":\"\"))&&k(a,\"class\",s)},d(t){t&&m(e)}}}function Be(e){let n,r,o,i;return n=new St({props:{token:e[21],index:-1}}),{c(){Z(n.$$.fragment),r=w(),o=h(\"div\"),k(o,\"class\",\"basis-full h-2\")},m(t,e){Q(n,t,e),f(t,r,e),f(t,o,e),i=!0},p:t,i(t){i||(X(n.$$.fragment,t),i=!0)},o(t){J(n.$$.fragment,t),i=!1},d(t){t&&(m(r),m(o)),tt(n,t)}}}function We(t){let e;let n=function(t){return 0===t[42]?Ye:Ge}(t),r=n(t);return{c(){r.c(),e=x()},m(t,n){r.m(t,n),f(t,e,n)},d(t){t&&m(e),r.d(t)}}}function Ge(t){let e,n,r=K({length:2}),o=[];for(let e=0;e<r.length;e+=1)o[e]=Ve(Ie(t,r,e));return{c(){for(let t=0;t<o.length;t+=1)o[t].c();e=w(),n=h(\"div\"),k(n,\"class\",\"basis-full h-0\")},m(t,r){for(let e=0;e<o.length;e+=1)o[e]&&o[e].m(t,r);f(t,e,r),f(t,n,r)},d(t){t&&(m(e),m(n)),g(o,t)}}}function Ye(t){let e;return{c(){e=h(\"div\"),k(e,\"class\",\"basis-full h-2\")},m(t,n){f(t,e,n)},d(t){t&&m(e)}}}function Ve(e){let n,r,o;return{c(){n=h(\"div\"),r=w(),o=h(\"span\"),o.textContent=\" \",k(n,\"class\",\"basis-full h-0\"),k(o,\"class\",\"inline-block\")},m(t,e){f(t,n,e),f(t,r,e),f(t,o,e)},p:t,d(t){t&&(m(n),m(r),m(o))}}}function Xe(t){let e,n,r,o=!0===t[40].special&&\"\"!==t[40].role&&We(t);return n=new St({props:{token:t[40],index:t[42],underlineStyle:t[8](t[40]),bgStyle:t[9](t[40])}}),{c(){o&&o.c(),e=w(),Z(n.$$.fragment)},m(t,i){o&&o.m(t,i),f(t,e,i),Q(n,t,i),r=!0},p(t,r){!0===t[40].special&&\"\"!==t[40].role?o||(o=We(t),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null);const i={};128&r[0]&&(i.token=t[40]),384&r[0]&&(i.underlineStyle=t[8](t[40])),640&r[0]&&(i.bgStyle=t[9](t[40])),n.$set(i)},i(t){r||(X(n.$$.fragment,t),r=!0)},o(t){J(n.$$.fragment,t),r=!1},d(t){t&&m(e),o&&o.d(t),tt(n,t)}}}function Je(t){let e;return{c(){e=h(\"span\"),e.textContent=\" \",k(e,\"class\",\"inline-block mt-2 border-b-2 border-white bg-gray-700 animate-cpulse\")},m(t,n){f(t,e,n)},d(t){t&&m(e)}}}function Ke(t){let e,n,r;return n=new vt({props:{audioData:t[4].value}}),{c(){e=h(\"div\"),Z(n.$$.fragment),k(e,\"class\",\"my-3\")},m(t,o){f(t,e,o),Q(n,e,null),r=!0},p(t,e){const r={};16&e[0]&&(r.audioData=t[4].value),n.$set(r)},i(t){r||(X(n.$$.fragment,t),r=!0)},o(t){J(n.$$.fragment,t),r=!1},d(t){t&&m(e),tt(n)}}}function Ze(t){let e,n,r,o;return{c(){e=h(\"div\"),n=h(\"video\"),r=h(\"source\"),l(r.src,o=`data:video/mp4;base64,${t[6].value}`)||k(r,\"src\",o),k(r,\"type\",\"video/mp4\"),n.controls=!0,k(e,\"class\",\"my-3\")},m(t,o){f(t,e,o),p(e,n),p(n,r)},p(t,e){64&e[0]&&!l(r.src,o=`data:video/mp4;base64,${t[6].value}`)&&k(r,\"src\",o)},d(t){t&&m(e)}}}function Qe(t){let e,n,r;return{c(){e=h(\"div\"),n=h(\"img\"),l(n.src,r=`data:image/png;base64,${t[5].value}`)||k(n,\"src\",r),k(n,\"alt\",\"Image output\"),k(e,\"class\",\"my-3\")},m(t,r){f(t,e,r),p(e,n)},p(t,e){32&e[0]&&!l(n.src,r=`data:image/png;base64,${t[5].value}`)&&k(n,\"src\",r)},d(t){t&&m(e)}}}function tn(t){let e,n,o,i,a,l,s,c,d,b,y,x,_,$,N,T;const M=[Pe,Fe],A=[];function S(t,e){return t[13]?0:1}o=S(t),i=A[o]=M[o](t);let C=t[1]&&Be(t),R=K(t[7]),D=[];for(let e=0;e<R.length;e+=1)D[e]=Xe(Oe(t,R,e));const L=t=>J(D[t],1,1,(()=>{D[t]=null}));let O=!1===t[0]&&Je(),I=null!==t[4]&&Ke(t),z=null!==t[6]&&Ze(t),F=null!==t[5]&&Qe(t);return{c(){e=h(\"div\"),n=h(\"div\"),i.c(),a=w(),l=h(\"div\"),s=h(\"div\"),c=h(\"span\"),C&&C.c(),d=w();for(let t=0;t<D.length;t+=1)D[t].c();b=w(),O&&O.c(),y=w(),I&&I.c(),x=w(),z&&z.c(),_=w(),F&&F.c(),k(e,\"class\",\"px-1 pt-1 pb-3 absolute opacity-95 bg-white shadow border border-gray-300 pointer-events-none z-50\"),E(e,\"top\",t[12]+\"px\"),E(e,\"left\",t[11]+\"px\"),E(e,\"display\",\"none\"),k(c,\"class\",\"flex flex-wrap text-sm\"),k(c,\"role\",\"main\"),k(s,\"class\",\"px-4\"),k(l,\"class\",\"pt-6 pb-6 flex text-gray-800 font-token\")},m(r,i){f(r,e,i),p(e,n),A[o].m(n,null),t[30](e),f(r,a,i),f(r,l,i),p(l,s),p(s,c),C&&C.m(c,null),p(c,d);for(let t=0;t<D.length;t+=1)D[t]&&D[t].m(c,null);p(c,b),O&&O.m(c,null),p(s,y),I&&I.m(s,null),p(s,x),z&&z.m(s,null),p(s,_),F&&F.m(s,null),$=!0,N||(T=[u(Ct.call(null,c,en)),v(c,\"longmouseover\",t[15]),v(c,\"longmouseout\",t[17]),v(c,\"mouseover\",t[16]),v(c,\"mouseout\",t[18]),v(c,\"focus\",t[19]),v(c,\"blur\",t[19])],N=!0)},p(t,r){let a=o;if(o=S(t),o===a?A[o].p(t,r):(Y(),J(A[a],1,1,(()=>{A[a]=null})),V(),i=A[o],i?i.p(t,r):(i=A[o]=M[o](t),i.c()),X(i,1),i.m(n,null)),(!$||4096&r[0])&&E(e,\"top\",t[12]+\"px\"),(!$||2048&r[0])&&E(e,\"left\",t[11]+\"px\"),t[1]?C?(C.p(t,r),2&r[0]&&X(C,1)):(C=Be(t),C.c(),X(C,1),C.m(c,d)):C&&(Y(),J(C,1,1,(()=>{C=null})),V()),896&r[0]){let e;for(R=K(t[7]),e=0;e<R.length;e+=1){const n=Oe(t,R,e);D[e]?(D[e].p(n,r),X(D[e],1)):(D[e]=Xe(n),D[e].c(),X(D[e],1),D[e].m(c,b))}for(Y(),e=R.length;e<D.length;e+=1)L(e);V()}!1===t[0]?O||(O=Je(),O.c(),O.m(c,null)):O&&(O.d(1),O=null),null!==t[4]?I?(I.p(t,r),16&r[0]&&X(I,1)):(I=Ke(t),I.c(),X(I,1),I.m(s,x)):I&&(Y(),J(I,1,1,(()=>{I=null})),V()),null!==t[6]?z?z.p(t,r):(z=Ze(t),z.c(),z.m(s,_)):z&&(z.d(1),z=null),null!==t[5]?F?F.p(t,r):(F=Qe(t),F.c(),F.m(s,null)):F&&(F.d(1),F=null)},i(t){if(!$){X(i),X(C);for(let t=0;t<R.length;t+=1)X(D[t]);X(I),$=!0}},o(t){J(i),J(C),D=D.filter(Boolean);for(let t=0;t<D.length;t+=1)J(D[t]);J(I),$=!1},d(n){n&&(m(e),m(a),m(l)),A[o].d(),t[30](null),C&&C.d(),g(D,n),O&&O.d(),I&&I.d(),z&&z.d(),F&&F.d(),N=!1,r(T)}}}const en=200;function nn(t,e,n){let{textComponents:r}=e,{tokenDetails:o}=e,{isCompleted:i}=e,{isError:a}=e,{requireFullReplay:l=!1}=e,{bgField:s=\"Token\"}=e,{underlineField:c=\"Probability\"}=e,u=t=>\"\",d=t=>\"\";const p=t=>{const e=(t=>{const e=t.match(/rgba?\\(\\s*(\\d+),\\s*(\\d+),\\s*(\\d+)/);return e?.299*parseInt(e[1],10)+.587*parseInt(e[2],10)+.114*parseInt(e[3],10):(console.error(\"Invalid RGBA format.\"),0)})(t);return e>186?\"rgba(0, 0, 0, 1)\":\"rgba(255, 255, 255, 1)\"},f=(t,e)=>{if(void 0===t)return\"\";let n=De(t);return`background-color: ${n}; color: ${p(n)};`},m=(t,e)=>{if(void 0===t)return\"\";return`border-bottom-color: ${Le(.7*t)};`},g=t=>{let e=\"\";return t.is_input?e=\"rgba(255, 255, 255, 0)\":t.is_force_forwarded?e=\"rgba(243, 244, 246, 1)\":t.is_generated?e=\"rgba(229, 231, 235, 1)\":(console.log(`ERROR: token ${t.text} does not have emit flags.`),e=\"rgba(255, 255, 255, 0)\"),`background-color: ${e};`},h=(t,e,n,r)=>{let o=!1,i=!1;return t<=n&&e-1>=n?o=!0:t<=r-1&&e>=r?(o=!0,i=!0):t>=n&&e<=r&&(o=!0),[o,i]};let b,y,w=null,x=null,v=null,k=[],_=[],$=[],E=new Set,N={},T=0,M={},A=0,S=0;let C=\"\",R=\"\";return t.$$set=t=>{\"textComponents\"in t&&n(22,r=t.textComponents),\"tokenDetails\"in t&&n(23,o=t.tokenDetails),\"isCompleted\"in t&&n(0,i=t.isCompleted),\"isError\"in t&&n(24,a=t.isError),\"requireFullReplay\"in t&&n(1,l=t.requireFullReplay),\"bgField\"in t&&n(2,s=t.bgField),\"underlineField\"in t&&n(3,c=t.underlineField)},t.$$.update=()=>{if(1069547773&t.$$.dirty[0]){for(0===r.length&&(n(7,k=[]),n(25,_=[]),n(26,$=[]),E.clear(),n(27,N={}),n(28,T=0));T<r.length;n(28,T+=1)){const t=r[T];if(lt(t))_.push(t),$.push(t.closer_text||\"\");else if(st(t))if(0===_.length)if(0!==$.length&&$[$.length-1]===t.value){const e={text:t.value,prob:t.prob,latency_ms:0,role:\"\",special:!0,is_input:t.is_input,is_force_forwarded:t.is_force_forwarded,is_generated:t.is_generated};E.add(e.text),k.push(e),$.pop()}else{const e={text:t.value,prob:t.prob,latency_ms:0,role:\"\",special:!1,is_input:t.is_input,is_force_forwarded:t.is_force_forwarded,is_generated:t.is_generated};k.push(e)}else{const e=_[_.length-1];e.text&&e.text!==t.value&&console.log(`Active role text does not match next text output: ${e.text} - ${t.value}`);const r={text:t.value,prob:t.prob,latency_ms:0,role:e.name||\"\",special:!0,is_input:t.is_input,is_force_forwarded:t.is_force_forwarded,is_generated:t.is_generated};\"\"!==r.role&&n(27,N[t.value]=r.role,N),E.add(r.text),k.push(r),_.pop()}else ut(t)?null===w&&n(4,w=t):ct(t)?null===x&&n(5,x=t):dt(t)&&null===v&&n(6,v=t)}0!==_.length||$.length;if(o.length>0){const t=function(t,e){const n=[];for(const r of e){let e=0;for(;-1!==(e=t.indexOf(r,e));)n.push([e,e+r.length,r]),e+=r.length}return n.sort(((t,e)=>t[0]===e[0]?t[1]-e[1]:t[0]-e[0])),n}(o.map((t=>t.text)).join(\"\"),Array.from(E));n(7,k=[]);let e=0,r=0,i=!1;for(const a of o){e=r,r=e+a.text.length;let o=!1,l=\"\";if(t.length>0){let[n,a,s]=t[0];e>=a&&(t.shift(),t.length>0&&([n,a,s]=t[0]));let[c,u]=h(e,r,n,a);if(c){if(Object.keys(N).includes(s)&&(i||(l=N[s],i=!0)),t.length>1){let[n,o,a]=t[1];const[s,c]=h(e,r,n,o);s&&Object.keys(N).includes(a)&&(l=N[a],i=!0,u=!1)}u||(o=!0)}else i=!1}const s={text:a.text,prob:a.prob,latency_ms:a.latency_ms,role:l,special:o,is_input:a.is_input,is_force_forwarded:a.is_force_forwarded,is_generated:a.is_generated,top_k:a.top_k};n(29,M[\"latency.max\"]=Math.max(s.latency_ms,M[\"latency.max\"]||0),M),k.push(s)}}n(8,u=!i||a?t=>\"border: none;\":\"Probability\"===c?t=>m(t.prob):\"Latency (ms)\"===c?t=>m(Math.log(t.latency_ms)/Math.log(M[\"latency.max\"])):t=>\"border: none;\"),!i||a||\"Type\"===s?n(9,d=t=>g(t)):\"Probability\"===s?n(9,d=t=>f(t.prob)):\"Latency (ms)\"===s?(n(9,d=t=>f(Math.log(t.latency_ms)/Math.log(M[\"latency.max\"]))),console.log(M[\"latency.max\"])):n(9,d=t=>\"\"),n(0,i),n(22,r),n(39,E),n(28,T),n(25,_),n(26,$),n(7,k),n(4,w),n(5,x),n(6,v),n(23,o),n(27,N),n(29,M),n(24,a),n(3,c),n(2,s),n(24,a),n(22,r),n(39,E),n(28,T),n(25,_),n(26,$),n(7,k),n(4,w),n(5,x),n(6,v),n(23,o),n(27,N),n(29,M),n(0,i),n(3,c),n(2,s),n(23,o),n(22,r),n(39,E),n(28,T),n(25,_),n(26,$),n(7,k),n(4,w),n(5,x),n(6,v),n(27,N),n(29,M),n(0,i),n(24,a),n(3,c),n(2,s),n(22,r),n(39,E),n(28,T),n(25,_),n(26,$),n(7,k),n(4,w),n(5,x),n(6,v),n(23,o),n(27,N),n(29,M),n(0,i),n(24,a),n(3,c),n(2,s),n(7,k),n(22,r),n(39,E),n(28,T),n(25,_),n(26,$),n(4,w),n(5,x),n(6,v),n(23,o),n(27,N),n(29,M),n(0,i),n(24,a),n(3,c),n(2,s)}},[i,l,s,c,w,x,v,k,u,d,b,A,S,y,(t,e)=>{if(\"Probability\"===e)return t.prob.toFixed(3);if(\"Latency (ms)\"===e)return t.latency_ms.toFixed(0);if(\"Type\"===e){if(t.is_input)return\"Input\";if(t.is_force_forwarded)return\"Forwarded\";if(t.is_generated)return\"Generated\"}else if(\"None\"===e)return\"\"},t=>{const e=t.detail.target;if(e.matches(\".token-grid-item\")){const t=e.dataset.index,r=15,o=10,i=e.getBoundingClientRect();n(11,A=i.left+window.scrollX+i.width/2+r),n(12,S=i.bottom+window.scrollY+o),n(10,b.style.display=\"block\",b);const a=Number(t);n(13,y=k[a]),A+b.offsetWidth>window.innerWidth&&n(11,A=window.innerWidth-b.offsetWidth),S+b.offsetHeight>window.innerHeight&&n(12,S=window.innerHeight-b.offsetHeight)}},t=>{var e;const n=t.target;if(n.matches(\".token-grid-item\")){const t=n.dataset.index,r=null===(e=n.parentElement)||void 0===e?void 0:e.querySelectorAll(`.token-grid-item[data-index=\"${t}\"]`);if(r)for(const t of r){const e=t;C=e.style.color,R=e.style.backgroundColor,e.style.color=\"rgb(249, 250, 251)\",e.style.backgroundColor=\"rgb(75, 85, 99)\"}}},t=>{t.detail.target.matches(\".token-grid-item\")&&n(10,b.style.display=\"none\",b)},t=>{var e;const n=t.target;if(n.matches(\".token-grid-item\")){const t=n.dataset.index,r=null===(e=n.parentElement)||void 0===e?void 0:e.querySelectorAll(`.token-grid-item[data-index=\"${t}\"]`);if(r)for(const t of r){const e=t;e.style.color=C,e.style.backgroundColor=R}}},t=>{},t=>Lt.sanitize(t.replaceAll(\" \",\"&nbsp;\").replaceAll(\"\\t\",\"\\\\t\").replaceAll(\"\\n\",\"\\\\n\")),{text:\"...\",prob:1,latency_ms:0,role:\"\",special:!1,is_input:!0,is_force_forwarded:!1,is_generated:!0},r,o,a,_,$,N,T,M,function(t){O[t?\"unshift\":\"push\"]((()=>{b=t,n(10,b)}))}]}class rn extends rt{constructor(t){super(),nt(this,t,nn,tn,i,{textComponents:22,tokenDetails:23,isCompleted:0,isError:24,requireFullReplay:1,bgField:2,underlineField:3},null,[-1,-1])}}function on(t){let e,n=null;return C((()=>{e=document.querySelector(\"html\"),window.addEventListener(\"load\",(()=>{n=setInterval((()=>{const t=e.getBoundingClientRect().height;if(0!==t&&e.checkVisibility()){const e={type:\"resize\",content:{height:`${t}px`,width:\"100%\"}};mt.set(e)}}),20)}))})),R((()=>{clearInterval(n)})),[]}class an extends rt{constructor(t){super(),nt(this,t,on,null,i,{})}}const{window:ln}=d;function sn(e){let n,r;return{c:t,m(t,o){n||(r=v(ln,\"message\",e[0]),n=!0)},p:t,i:t,o:t,d(t){n=!1,r()}}}function cn(t){let e=null,n=null;return C((()=>{e=mt.subscribe((t=>{void 0!==t&&window.parent.postMessage(t,\"*\")})),n=gt.subscribe((t=>{void 0!==t&&window.parent.postMessage(t,\"*\")}))})),R((()=>{e&&e(),n&&n()})),[t=>{if(t.source===window.parent&&\"type\"in t.data)if(\"kernelmsg\"===t.data.type){let e=t.data;ft.set(e)}else if(\"init_state\"===t.data.type){let e=t.data;gt.set(e)}}]}class un extends rt{constructor(t){super(),nt(this,t,cn,sn,i,{})}}function dn(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function pn(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function fn(t){let e,n,r;function o(t,r,o=0,i=t.length){if(o<i){if(0!==e(r,r))return i;do{const e=o+i>>>1;n(t[e],r)<0?o=e+1:i=e}while(o<i)}return o}return 2!==t.length?(e=dn,n=(e,n)=>dn(t(e),n),r=(e,n)=>t(e)-n):(e=t===dn||t===pn?t:mn,n=t,r=t),{left:o,center:function(t,e,n=0,i=t.length){const a=o(t,e,n,i-1);return a>n&&r(t[a-1],e)>-r(t[a],e)?a-1:a},right:function(t,r,o=0,i=t.length){if(o<i){if(0!==e(r,r))return i;do{const e=o+i>>>1;n(t[e],r)<=0?o=e+1:i=e}while(o<i)}return o}}}function mn(){return 0}const gn=fn(dn).right;fn((function(t){return null===t?NaN:+t})).center;const hn=Math.sqrt(50),bn=Math.sqrt(10),yn=Math.sqrt(2);function wn(t,e,n){const r=(e-t)/Math.max(0,n),o=Math.floor(Math.log10(r)),i=r/Math.pow(10,o),a=i>=hn?10:i>=bn?5:i>=yn?2:1;let l,s,c;return o<0?(c=Math.pow(10,-o)/a,l=Math.round(t*c),s=Math.round(e*c),l/c<t&&++l,s/c>e&&--s,c=-c):(c=Math.pow(10,o)*a,l=Math.round(t/c),s=Math.round(e/c),l*c<t&&++l,s*c>e&&--s),s<l&&.5<=n&&n<2?wn(t,e,2*n):[l,s,c]}function xn(t,e,n){return wn(t=+t,e=+e,n=+n)[2]}function vn(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function kn(t){return+t}var _n=[0,1];function $n(t){return t}function En(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:(n=isNaN(e)?NaN:.5,function(){return n});var n}function Nn(t,e,n){var r=t[0],o=t[1],i=e[0],a=e[1];return o<r?(r=En(o,r),i=n(a,i)):(r=En(r,o),i=n(i,a)),function(t){return i(r(t))}}function Tn(t,e,n){var r=Math.min(t.length,e.length)-1,o=new Array(r),i=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)o[a]=En(t[a],t[a+1]),i[a]=n(e[a],e[a+1]);return function(e){var n=gn(t,e,1,r)-1;return i[n](o[n](e))}}function Mn(){var t,e,n,r,o,i,a=_n,l=_n,s=Se,c=$n;function u(){var t,e,n,s=Math.min(a.length,l.length);return c!==$n&&(t=a[0],e=a[s-1],t>e&&(n=t,t=e,e=n),c=function(n){return Math.max(t,Math.min(e,n))}),r=s>2?Tn:Nn,o=i=null,d}function d(e){return null==e||isNaN(e=+e)?n:(o||(o=r(a.map(t),l,s)))(t(c(e)))}return d.invert=function(n){return c(e((i||(i=r(l,a.map(t),Ee)))(n)))},d.domain=function(t){return arguments.length?(a=Array.from(t,kn),u()):a.slice()},d.range=function(t){return arguments.length?(l=Array.from(t),u()):l.slice()},d.rangeRound=function(t){return l=Array.from(t),s=Ce,u()},d.clamp=function(t){return arguments.length?(c=!!t||$n,u()):c!==$n},d.interpolate=function(t){return arguments.length?(s=t,u()):s},d.unknown=function(t){return arguments.length?(n=t,d):n},function(n,r){return t=n,e=r,u()}}function An(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf(\"e\"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function Sn(t){return(t=An(Math.abs(t)))?t[1]:NaN}var Cn,Rn=/^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;function Dn(t){if(!(e=Rn.exec(t)))throw new Error(\"invalid format: \"+t);var e;return new Ln({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function Ln(t){this.fill=void 0===t.fill?\" \":t.fill+\"\",this.align=void 0===t.align?\">\":t.align+\"\",this.sign=void 0===t.sign?\"-\":t.sign+\"\",this.symbol=void 0===t.symbol?\"\":t.symbol+\"\",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?\"\":t.type+\"\"}function On(t,e){var n=An(t,e);if(!n)return t+\"\";var r=n[0],o=n[1];return o<0?\"0.\"+new Array(-o).join(\"0\")+r:r.length>o+1?r.slice(0,o+1)+\".\"+r.slice(o+1):r+new Array(o-r.length+2).join(\"0\")}Dn.prototype=Ln.prototype,Ln.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?\"0\":\"\")+(void 0===this.width?\"\":Math.max(1,0|this.width))+(this.comma?\",\":\"\")+(void 0===this.precision?\"\":\".\"+Math.max(0,0|this.precision))+(this.trim?\"~\":\"\")+this.type};var In={\"%\":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+\"\",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString(\"en\").replace(/,/g,\"\"):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>On(100*t,e),r:On,s:function(t,e){var n=An(t,e);if(!n)return t+\"\";var r=n[0],o=n[1],i=o-(Cn=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,a=r.length;return i===a?r:i>a?r+new Array(i-a+1).join(\"0\"):i>0?r.slice(0,i)+\".\"+r.slice(i):\"0.\"+new Array(1-i).join(\"0\")+An(t,Math.max(0,e+i-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function zn(t){return t}var Fn,Pn,Un,Hn=Array.prototype.map,jn=[\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"µ\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"];function qn(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?zn:(e=Hn.call(t.grouping,Number),n=t.thousands+\"\",function(t,r){for(var o=t.length,i=[],a=0,l=e[0],s=0;o>0&&l>0&&(s+l+1>r&&(l=Math.max(1,r-s)),i.push(t.substring(o-=l,o+l)),!((s+=l+1)>r));)l=e[a=(a+1)%e.length];return i.reverse().join(n)}),o=void 0===t.currency?\"\":t.currency[0]+\"\",i=void 0===t.currency?\"\":t.currency[1]+\"\",a=void 0===t.decimal?\".\":t.decimal+\"\",l=void 0===t.numerals?zn:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Hn.call(t.numerals,String)),s=void 0===t.percent?\"%\":t.percent+\"\",c=void 0===t.minus?\"−\":t.minus+\"\",u=void 0===t.nan?\"NaN\":t.nan+\"\";function d(t){var e=(t=Dn(t)).fill,n=t.align,d=t.sign,p=t.symbol,f=t.zero,m=t.width,g=t.comma,h=t.precision,b=t.trim,y=t.type;\"n\"===y?(g=!0,y=\"g\"):In[y]||(void 0===h&&(h=12),b=!0,y=\"g\"),(f||\"0\"===e&&\"=\"===n)&&(f=!0,e=\"0\",n=\"=\");var w=\"$\"===p?o:\"#\"===p&&/[boxX]/.test(y)?\"0\"+y.toLowerCase():\"\",x=\"$\"===p?i:/[%p]/.test(y)?s:\"\",v=In[y],k=/[defgprs%]/.test(y);function _(t){var o,i,s,p=w,_=x;if(\"c\"===y)_=v(t)+_,t=\"\";else{var $=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:v(Math.abs(t),h),b&&(t=function(t){t:for(var e,n=t.length,r=1,o=-1;r<n;++r)switch(t[r]){case\".\":o=e=r;break;case\"0\":0===o&&(o=r),e=r;break;default:if(!+t[r])break t;o>0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t}(t)),$&&0==+t&&\"+\"!==d&&($=!1),p=($?\"(\"===d?d:c:\"-\"===d||\"(\"===d?\"\":d)+p,_=(\"s\"===y?jn[8+Cn/3]:\"\")+_+($&&\"(\"===d?\")\":\"\"),k)for(o=-1,i=t.length;++o<i;)if(48>(s=t.charCodeAt(o))||s>57){_=(46===s?a+t.slice(o+1):t.slice(o))+_,t=t.slice(0,o);break}}g&&!f&&(t=r(t,1/0));var E=p.length+t.length+_.length,N=E<m?new Array(m-E+1).join(e):\"\";switch(g&&f&&(t=r(N+t,N.length?m-_.length:1/0),N=\"\"),n){case\"<\":t=p+t+_+N;break;case\"=\":t=p+N+t+_;break;case\"^\":t=N.slice(0,E=N.length>>1)+p+t+_+N.slice(E);break;default:t=N+p+t+_}return l(t)}return h=void 0===h?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,h)):Math.max(0,Math.min(20,h)),_.toString=function(){return t+\"\"},_}return{format:d,formatPrefix:function(t,e){var n=d(((t=Dn(t)).type=\"f\",t)),r=3*Math.max(-8,Math.min(8,Math.floor(Sn(e)/3))),o=Math.pow(10,-r),i=jn[8+r/3];return function(t){return n(o*t)+i}}}}function Bn(t,e,n,r){var o,i=function(t,e,n){n=+n;const r=(e=+e)<(t=+t),o=r?xn(e,t,n):xn(t,e,n);return(r?-1:1)*(o<0?1/-o:o)}(t,e,n);switch((r=Dn(null==r?\",f\":r)).type){case\"s\":var a=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(o=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Sn(e)/3)))-Sn(Math.abs(t)))}(i,a))||(r.precision=o),Un(r,a);case\"\":case\"e\":case\"g\":case\"p\":case\"r\":null!=r.precision||isNaN(o=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Sn(e)-Sn(t))+1}(i,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=o-(\"e\"===r.type));break;case\"f\":case\"%\":null!=r.precision||isNaN(o=function(t){return Math.max(0,-Sn(Math.abs(t)))}(i))||(r.precision=o-2*(\"%\"===r.type))}return Pn(r)}function Wn(t){var e=t.domain;return t.ticks=function(t){var n=e();return function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)==(e=+e))return[t];const r=e<t,[o,i,a]=r?wn(e,t,n):wn(t,e,n);if(!(i>=o))return[];const l=i-o+1,s=new Array(l);if(r)if(a<0)for(let t=0;t<l;++t)s[t]=(i-t)/-a;else for(let t=0;t<l;++t)s[t]=(i-t)*a;else if(a<0)for(let t=0;t<l;++t)s[t]=(o+t)/-a;else for(let t=0;t<l;++t)s[t]=(o+t)*a;return s}(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return Bn(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,o,i=e(),a=0,l=i.length-1,s=i[a],c=i[l],u=10;for(c<s&&(o=s,s=c,c=o,o=a,a=l,l=o);u-- >0;){if((o=xn(s,c,n))===r)return i[a]=s,i[l]=c,e(i);if(o>0)s=Math.floor(s/o)*o,c=Math.ceil(c/o)*o;else{if(!(o<0))break;s=Math.ceil(s*o)/o,c=Math.floor(c*o)/o}r=o}return t},t}function Gn(){var t=Mn()($n,$n);return t.copy=function(){return e=t,Gn().domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown());var e},vn.apply(t,arguments),Wn(t)}function Yn(e){let n,r,o,i,a,l;return{c(){n=h(\"div\"),r=b(\"svg\"),o=b(\"g\"),i=b(\"path\"),k(i,\"d\",a=e[3].map(Vn).join(\" \")),k(i,\"fill\",\"none\"),k(i,\"stroke-width\",\"1.25\"),k(i,\"stroke\",\"#374151\"),k(r,\"class\",e[0]),k(n,\"class\",\"inline-block font-medium text-gray-700\"),U((()=>e[9].call(n)))},m(t,a){f(t,n,a),p(n,r),p(r,o),p(o,i),l=function(t,e){\"static\"===getComputedStyle(t).position&&(t.style.position=\"relative\");const n=h(\"iframe\");n.setAttribute(\"style\",\"display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;\"),n.setAttribute(\"aria-hidden\",\"true\"),n.tabIndex=-1;const r=M();let o;return r?(n.src=\"data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\\/script>\",o=v(window,\"message\",(t=>{t.source===n.contentWindow&&e()}))):(n.src=\"about:blank\",n.onload=()=>{o=v(n.contentWindow,\"resize\",e),e()}),p(t,n),()=>{(r||o&&n.contentWindow)&&o(),m(n)}}(n,e[9].bind(n))},p(t,[e]){8&e&&a!==(a=t[3].map(Vn).join(\" \"))&&k(i,\"d\",a),1&e&&k(r,\"class\",t[0])},i:t,o:t,d(t){t&&m(n),l()}}}Fn=qn({thousands:\",\",grouping:[3],currency:[\"$\",\"\"]}),Pn=Fn.format,Un=Fn.formatPrefix;const Vn=(t,e)=>`${0===e?\"M\":\"L\"} ${t.x} ${t.y}`;function Xn(t,e,n){let r,o,i,a,{values:l}=e,{svgClass:s}=e,{padding:c={left:0,right:0,top:0,bottom:0}}=e,u=0,d=0;return t.$$set=t=>{\"values\"in t&&n(4,l=t.values),\"svgClass\"in t&&n(0,s=t.svgClass),\"padding\"in t&&n(5,c=t.padding)},t.$$.update=()=>{16&t.$$.dirty&&n(8,r=l),292&t.$$.dirty&&n(7,o=Gn().domain([0,r.length-1]).range([c.left,c.left+d-c.right])),34&t.$$.dirty&&n(6,i=Gn().domain([0,1]).range([u-c.bottom,c.top])),448&t.$$.dirty&&n(3,a=r.map(((t,e)=>({x:o(e),y:i(t)}))))},[s,u,d,a,l,c,i,o,r,function(){u=this.clientHeight,d=this.clientWidth,n(1,u),n(2,d)}]}class Jn extends rt{constructor(t){super(),nt(this,t,Xn,Yn,i,{values:4,svgClass:0,padding:5})}}function Kn(e){let n,r,o,i,a=e[0].name+\"\";function l(t,e){return\"number\"==typeof t[1]?tr:Qn}let s=l(e),u=s(e);return{c(){n=h(\"span\"),r=y(a),o=w(),u.c(),i=x(),k(n,\"class\",c(\"text-gray-600 whitespace-nowrap pr-[0.125rem]\")+\" svelte-198q8s6\")},m(t,e){f(t,n,e),p(n,r),f(t,o,e),u.m(t,e),f(t,i,e)},p(t,e){1&e&&a!==(a=t[0].name+\"\")&&_(r,a),s===(s=l(t))&&u?u.p(t,e):(u.d(1),u=s(t),u&&(u.c(),u.m(i.parentNode,i)))},i:t,o:t,d(t){t&&(m(n),m(o),m(i)),u.d(t)}}}function Zn(t){let e,n,r,o,i,a=t[0].name+\"\";return o=new Jn({props:{values:t[1],svgClass:\"w-8 h-4 inline\",padding:t[2]}}),{c(){e=h(\"span\"),n=y(a),r=w(),Z(o.$$.fragment),k(e,\"class\",c(\"text-gray-600 whitespace-nowrap pr-[0.125rem]\")+\" svelte-198q8s6\")},m(t,a){f(t,e,a),p(e,n),f(t,r,a),Q(o,t,a),i=!0},p(t,e){(!i||1&e)&&a!==(a=t[0].name+\"\")&&_(n,a);const r={};2&e&&(r.values=t[1]),o.$set(r)},i(t){i||(X(o.$$.fragment,t),i=!0)},o(t){J(o.$$.fragment,t),i=!1},d(t){t&&(m(e),m(r)),tt(o,t)}}}function Qn(t){let e,n,r,o=\"\"!==t[0].units&&er(t);return{c(){e=h(\"span\"),n=y(t[1]),r=w(),o&&o.c(),k(e,\"class\",c(\"font-medium text-center text-gray-700 \")+\" svelte-198q8s6\")},m(t,i){f(t,e,i),p(e,n),p(e,r),o&&o.m(e,null)},p(t,r){2&r&&_(n,t[1]),\"\"!==t[0].units?o?o.p(t,r):(o=er(t),o.c(),o.m(e,null)):o&&(o.d(1),o=null)},d(t){t&&m(e),o&&o.d()}}}function tr(t){let e,n,r,o=t[1].toFixed(t[0].precision)+\"\",i=\"\"!==t[0].units&&nr(t);return{c(){e=h(\"span\"),n=y(o),r=w(),i&&i.c(),k(e,\"class\",c(\"font-medium text-gray-700 \")+\" svelte-198q8s6\")},m(t,o){f(t,e,o),p(e,n),p(e,r),i&&i.m(e,null)},p(t,r){3&r&&o!==(o=t[1].toFixed(t[0].precision)+\"\")&&_(n,o),\"\"!==t[0].units?i?i.p(t,r):(i=nr(t),i.c(),i.m(e,null)):i&&(i.d(1),i=null)},d(t){t&&m(e),i&&i.d()}}}function er(t){let e,n,r=t[0].units+\"\";return{c(){e=h(\"span\"),n=y(r),k(e,\"class\",\"\")},m(t,r){f(t,e,r),p(e,n)},p(t,e){1&e&&r!==(r=t[0].units+\"\")&&_(n,r)},d(t){t&&m(e)}}}function nr(t){let e,n,r=t[0].units+\"\";return{c(){e=h(\"span\"),n=y(r),k(e,\"class\",\"\")},m(t,r){f(t,e,r),p(e,n)},p(t,e){1&e&&r!==(r=t[0].units+\"\")&&_(n,r)},d(t){t&&m(e)}}}function rr(t){let e,n,r,o,i,a;const l=[Zn,Kn],s=[];function u(t,e){return t[1].constructor===Array?0:1}return r=u(t),o=s[r]=l[r](t),{c(){e=h(\"span\"),n=h(\"span\"),o.c(),k(e,\"class\",c(\"dot-divider flex items-center text-xs whitespace-nowrap px-1\")+\" svelte-198q8s6\"),k(e,\"title\",i=t[0].description)},m(t,o){f(t,e,o),p(e,n),s[r].m(n,null),a=!0},p(t,[c]){let d=r;r=u(t),r===d?s[r].p(t,c):(Y(),J(s[d],1,1,(()=>{s[d]=null})),V(),o=s[r],o?o.p(t,c):(o=s[r]=l[r](t),o.c()),X(o,1),o.m(n,null)),(!a||1&c&&i!==(i=t[0].description))&&k(e,\"title\",i)},i(t){a||(X(o),a=!0)},o(t){J(o),a=!1},d(t){t&&m(e),s[r].d()}}}function or(t,e,n){let{metricDef:r}=e,{value:o}=e;return t.$$set=t=>{\"metricDef\"in t&&n(0,r=t.metricDef),\"value\"in t&&n(1,o=t.value)},[r,o,{left:0,right:0,top:5,bottom:3}]}ot('.dot-divider.svelte-198q8s6:not(:last-child):after{color:#d1d5db;content:\"•\";margin-left:.5rem}');class ir extends rt{constructor(t){super(),nt(this,t,or,rr,i,{metricDef:0,value:1})}}function ar(t){var e=function(e){var n=e.target;t.contains(n)||t.dispatchEvent(new CustomEvent(\"outclick\"))};return document.addEventListener(\"click\",e,!0),{destroy:function(){document.removeEventListener(\"click\",e,!0)}}}function lr(t,e,n){const r=t.slice();return r[10]=e[n],r[12]=n,r}function sr(t){let e,n=K(t[1]),r=[];for(let e=0;e<n.length;e+=1)r[e]=cr(lr(t,n,e));return{c(){e=h(\"ul\");for(let t=0;t<r.length;t+=1)r[t].c();k(e,\"role\",\"listbox\"),k(e,\"class\",\"absolute pt-2 pb-3 z-10 mt-1 bg-white shadow border border-gray-300\")},m(t,n){f(t,e,n);for(let t=0;t<r.length;t+=1)r[t]&&r[t].m(e,null)},p(t,o){if(66&o){let i;for(n=K(t[1]),i=0;i<n.length;i+=1){const a=lr(t,n,i);r[i]?r[i].p(a,o):(r[i]=cr(a),r[i].c(),r[i].m(e,null))}for(;i<r.length;i+=1)r[i].d(1);r.length=n.length}},d(t){t&&m(e),g(r,t)}}}function cr(t){let e,n,o,i,a=t[10]+\"\";function l(...e){return t[8](t[10],...e)}return{c(){e=h(\"li\"),n=y(a),k(e,\"class\",`w-full px-4 py-1 ${0===t[12]?\"mt-1\":\"\"} hover:bg-gray-700 hover:text-white text-nowrap`),k(e,\"role\",\"option\"),k(e,\"aria-selected\",\"false\")},m(t,r){f(t,e,r),p(e,n),o||(i=[v(e,\"click\",l),v(e,\"keypress\",dr)],o=!0)},p(e,r){t=e,2&r&&a!==(a=t[10]+\"\")&&_(n,a)},d(t){t&&m(e),o=!1,r(i)}}}function ur(e){let n,o,i,a,l,s,c,d,g,x,$,E,N=e[3]&&sr(e);return{c(){n=h(\"div\"),o=h(\"button\"),i=h(\"span\"),a=h(\"span\"),l=y(e[2]),s=w(),c=b(\"svg\"),d=b(\"path\"),x=w(),N&&N.c(),k(a,\"class\",\"\"),k(d,\"fill-rule\",\"evenodd\"),k(d,\"d\",\"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z\"),k(d,\"clip-rule\",\"evenodd\"),k(c,\"xmlns\",\"http://www.w3.org/2000/svg\"),k(c,\"viewBox\",\"0 0 16 16\"),k(c,\"fill\",\"currentColor\"),k(c,\"class\",\"size-4\"),k(i,\"class\",g=`mr-4 inline-flex justify-between items-center hover:bg-gray-700 hover:text-white ${e[0]}`),k(n,\"class\",\"relative\")},m(t,r){f(t,n,r),p(n,o),p(o,i),p(i,a),p(a,l),p(i,s),p(i,c),p(c,d),p(n,x),N&&N.m(n,null),$||(E=[u(ar.call(null,o)),v(o,\"click\",e[4]),u(ar.call(null,n)),v(n,\"outclick\",e[5])],$=!0)},p(t,[e]){4&e&&_(l,t[2]),1&e&&g!==(g=`mr-4 inline-flex justify-between items-center hover:bg-gray-700 hover:text-white ${t[0]}`)&&k(i,\"class\",g),t[3]?N?N.p(t,e):(N=sr(t),N.c(),N.m(n,null)):N&&(N.d(1),N=null)},i:t,o:t,d(t){t&&m(n),N&&N.d(),$=!1,r(E)}}}const dr=t=>{};function pr(t,e,n){let{classes:r=\"\"}=e,{values:o=[]}=e,{defaultValue:i=\"\"}=e,a=i,l=!1;const s=D(),c=t=>{n(2,a=t),n(3,l=!1),s(\"select\",a)};return t.$$set=t=>{\"classes\"in t&&n(0,r=t.classes),\"values\"in t&&n(1,o=t.values),\"defaultValue\"in t&&n(7,i=t.defaultValue)},[r,o,a,l,t=>{n(3,l=!l)},t=>{n(3,l=!1)},c,i,(t,e)=>c(t)]}class fr extends rt{constructor(t){super(),nt(this,t,pr,ur,i,{classes:0,values:1,defaultValue:7})}}var mr={status:{name:\"\",units:\"\",description:\"Determines whether engine is running, completed or in error.\",isScalar:!0,precision:0},cpu:{name:\"CPU\",units:\"%\",description:\"Average utilization across CPU cores.\",isScalar:!1,precision:1},gpu:{name:\"GPU\",units:\"%\",description:\"Average utilization across GPUs.\",isScalar:!1,precision:1},ram:{name:\"RAM\",units:\"GB\",description:\"Utilization of RAM.\",isScalar:!0,precision:1},vram:{name:\"VRAM\",units:\"GB\",description:\"Utilization of video RAM.\",isScalar:!0,precision:1},\"wall time\":{name:\"Time\",units:\"s\",description:\"Time taken from initial display to engine completion.\",isScalar:!0,precision:1},\"avg latency\":{name:\"Latency\",units:\"ms\",description:\"Average roundtrip latency per token\",isScalar:!0,precision:0},consumed:{name:\"Used\",units:\"tkn\",description:\"Total tokens consumed by language model.\",isScalar:!0,precision:0},\"token reduction\":{name:\"Reduced\",units:\"%\",description:\"Total tokens consumed by language model divided by total tokens.\",isScalar:!0,precision:0}};function gr(t,e,n){const r=t.slice();return r[8]=e[n],r}function hr(t){let e,n;return e=new ir({props:{value:t[0].metrics[t[8]],metricDef:mr[t[8]]}}),{c(){Z(e.$$.fragment)},m(t,r){Q(e,t,r),n=!0},p(t,n){const r={};1&n&&(r.value=t[0].metrics[t[8]]),1&n&&(r.metricDef=mr[t[8]]),e.$set(r)},i(t){n||(X(e.$$.fragment,t),n=!0)},o(t){J(e.$$.fragment,t),n=!1},d(t){tt(e,t)}}}function br(t){let e,n,r,o,i,a,l,s,c,u,d,b,y,x,v,_,$,E,N,T;r=new un({}),i=new an({}),b=new fr({props:{values:[\"None\",\"Type\",\"Probability\",\"Latency (ms)\"],classes:\"ml-4 pl-1 bg-gray-200\",defaultValue:\"Type\"}}),b.$on(\"select\",t[5]),x=new fr({props:{values:[\"None\",\"Probability\",\"Latency (ms)\"],classes:\"border-b-2 pl-1 border-gray-400\",defaultValue:\"Probability\"}}),x.$on(\"select\",t[6]);let M=K(t[0].shownMetrics),A=[];for(let e=0;e<M.length;e+=1)A[e]=hr(gr(t,M,e));const S=t=>J(A[t],1,1,(()=>{A[t]=null}));return N=new rn({props:{textComponents:t[0].textComponents,tokenDetails:t[0].tokenDetails,isCompleted:[\"Done\",\"Error\"].includes(t[0].status),isError:t[0].status===pt.Error,bgField:t[1],underlineField:t[2],requireFullReplay:t[0].requireFullReplay}}),{c(){e=h(\"meta\"),n=w(),Z(r.$$.fragment),o=w(),Z(i.$$.fragment),a=w(),l=h(\"div\"),s=h(\"nav\"),c=h(\"section\"),u=h(\"div\"),d=h(\"span\"),Z(b.$$.fragment),y=w(),Z(x.$$.fragment),v=w(),_=h(\"span\");for(let t=0;t<A.length;t+=1)A[t].c();$=w(),E=h(\"section\"),Z(N.$$.fragment),document.title=\"graphpaper\",k(e,\"name\",\"description\"),k(e,\"content\",\"graphpaper\"),k(d,\"class\",\"flex mr-2\"),k(_,\"class\",\"flex mr-4 text-gray-300 overflow-x-scroll scrollbar-thin scrollbar-track-gray-100 scrollbar-thumb-gray-200\"),k(u,\"class\",\"text-sm pt-2 pb-2 flex justify-between border-b border-gray-200\"),k(c,\"class\",\"\"),k(s,\"class\",\"sticky top-0 z-50 opacity-90\"),k(E,\"class\",\"w-full\"),k(l,\"class\",\"w-full min-h-72\")},m(t,m){p(document.head,e),f(t,n,m),Q(r,t,m),f(t,o,m),Q(i,t,m),f(t,a,m),f(t,l,m),p(l,s),p(s,c),p(c,u),p(u,d),Q(b,d,null),p(d,y),Q(x,d,null),p(u,v),p(u,_);for(let t=0;t<A.length;t+=1)A[t]&&A[t].m(_,null);p(l,$),p(l,E),Q(N,E,null),T=!0},p(t,[e]){if(1&e){let n;for(M=K(t[0].shownMetrics),n=0;n<M.length;n+=1){const r=gr(t,M,n);A[n]?(A[n].p(r,e),X(A[n],1)):(A[n]=hr(r),A[n].c(),X(A[n],1),A[n].m(_,null))}for(Y(),n=M.length;n<A.length;n+=1)S(n);V()}const n={};1&e&&(n.textComponents=t[0].textComponents),1&e&&(n.tokenDetails=t[0].tokenDetails),1&e&&(n.isCompleted=[\"Done\",\"Error\"].includes(t[0].status)),1&e&&(n.isError=t[0].status===pt.Error),2&e&&(n.bgField=t[1]),4&e&&(n.underlineField=t[2]),1&e&&(n.requireFullReplay=t[0].requireFullReplay),N.$set(n)},i(t){if(!T){X(r.$$.fragment,t),X(i.$$.fragment,t),X(b.$$.fragment,t),X(x.$$.fragment,t);for(let t=0;t<M.length;t+=1)X(A[t]);X(N.$$.fragment,t),T=!0}},o(t){J(r.$$.fragment,t),J(i.$$.fragment,t),J(b.$$.fragment,t),J(x.$$.fragment,t),A=A.filter(Boolean);for(let t=0;t<A.length;t+=1)J(A[t]);J(N.$$.fragment,t),T=!1},d(t){t&&(m(n),m(o),m(a),m(l)),m(e),tt(r,t),tt(i,t),tt(b),tt(x),g(A,t),tt(N)}}}function yr(t,e,n){let r,o;s(t,ft,(t=>n(3,r=t))),s(t,gt,(t=>n(4,o=t)));let i={textComponents:[],tokenDetails:[],status:pt.Running,shownMetrics:[],metrics:{status:pt.Running,\"wall time\":0,consumed:0,\"token reduction\":0,\"avg latency\":0,cpu:[0,0,0,0,0],gpu:[0,0,0,0,0],ram:0,vram:0},requireFullReplay:!1},a=\"Type\",l=\"Probability\";C((()=>{const t={type:\"clientmsg\",content:JSON.stringify({class_name:\"ClientReadyMessage\"})};mt.set(t)}));return t.$$.update=()=>{if(16&t.$$.dirty&&void 0!==o&&\"\"!==o.content&&n(0,i=JSON.parse(o.content)),8&t.$$.dirty&&void 0!==r&&\"\"!==r.content){(t=>{if(null!=(e=t)&&\"TraceMessage\"===e.class_name)st(t.node_attr)||lt(t.node_attr)||function(t){return null!=t&&\"RoleCloserInput\"===t.class_name}(t.node_attr)?i.textComponents.push(t.node_attr):ut(t.node_attr)?(console.log(\"Audio available\"),i.textComponents.push(t.node_attr)):ct(t.node_attr)?(console.log(\"Image available\"),i.textComponents.push(t.node_attr)):dt(t.node_attr)&&(console.log(\"Video available\"),i.textComponents.push(t.node_attr));else if(function(t){return null!=t&&\"ExecutionStartedMessage\"===t.class_name}(t))n(0,i.requireFullReplay=!1,i);else if(function(t){return null!=t&&\"ClientReadyAckMessage\"===t.class_name}(t)){if(i.requireFullReplay){console.log(\"Require full replay and went past completion output message.\");const t={type:\"clientmsg\",content:JSON.stringify({class_name:\"OutputRequestMessage\"})};mt.set(t)}}else if(function(t){return null!=t&&\"ResetDisplayMessage\"===t.class_name}(t))n(0,i.textComponents=[],i),n(0,i.status=i.status!==pt.Error?pt.Running:i.status,i);else if(function(t){return null!=t&&\"MetricMessage\"===t.class_name}(t)){const e=t.name,r=t.value;if(e in i.metrics&&e in mr){let t=i.metrics[e];const o=mr[e];!1===o.isScalar?r.constructor===Array?n(0,i.metrics[e]=r,i):n(0,i.metrics[e]=[...t.slice(1),r],i):!0===o.isScalar?n(0,i.metrics[e]=r,i):console.error(`Cannot handle metric: ${e}: ${r}.`),\"status\"===e&&n(0,i.status=r,i)}}else if(function(t){return null!=t&&\"ExecutionCompletedMessage\"===t.class_name}(t))n(0,i.status=pt.Done,i);else if(function(t){return null!=t&&\"TokensMessage\"===t.class_name}(t)){n(0,i.requireFullReplay=!1,i),n(0,i.status=pt.Done,i),n(0,i.tokenDetails=t.tokens,i);const e={type:\"state\",content:JSON.stringify(i)};gt.set(e)}var e;n(0,i),n(4,o)})(JSON.parse(r.content))}1&t.$$.dirty&&(i.status===pt.Running?n(0,i.shownMetrics=[\"status\",\"wall time\",\"cpu\",\"ram\",\"gpu\",\"vram\"],i):n(0,i.shownMetrics=[\"status\",\"consumed\",\"token reduction\",\"avg latency\",\"wall time\"],i))},[i,a,l,r,o,t=>n(1,a=t.detail),t=>n(2,l=t.detail)]}return new class extends rt{constructor(t){super(),nt(this,t,yr,br,i,{})}}({target:document.body})}();\n</script>\n</body>\n</html>\n"
      }
     }
    },
    "version_major": 2,
    "version_minor": 0
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
